From d5447eb9c02e0f64f70f2abd94a705b376ba590a Mon Sep 17 00:00:00 2001 From: Simon South Date: Sun, 25 Oct 2015 06:27:26 -0400 Subject: [PATCH] runtime_loader: Do not assume executable has dynamic segment This prevents a crash when loading a statically linked executable. Fixes #12287. Signed-off-by: Adrien Destugues --- src/system/runtime_loader/elf_symbol_lookup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/runtime_loader/elf_symbol_lookup.h b/src/system/runtime_loader/elf_symbol_lookup.h index 433c9abb51a..247c945b371 100644 --- a/src/system/runtime_loader/elf_symbol_lookup.h +++ b/src/system/runtime_loader/elf_symbol_lookup.h @@ -58,7 +58,7 @@ struct SymbolLookupInfo { struct SymbolLookupCache { SymbolLookupCache(image_t* image) : - fTableSize(image->symhash[1]), + fTableSize(image->symhash != NULL ? image->symhash[1] : 0), fValues(NULL), fDSOs(NULL), fValuesResolved(NULL)