From 1707989955983663933377329952944577678076 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 11 Jun 2024 12:24:18 -0400 Subject: ELF: Fix crash if an entry point function fails to load Just needed a null check around this --- view/elf/elfview.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'view/elf/elfview.cpp') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index a01d043b..defd6600 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -1541,12 +1541,18 @@ bool ElfView::Init() if (entryArch != entryPointArch) { auto func = AddFunctionForAnalysis(platform->GetRelatedPlatform(entryArch), entry); - AddToEntryFunctions(func); + if (func) + { + AddToEntryFunctions(func); + } } else { auto func = AddFunctionForAnalysis(platform, entry); - AddToEntryFunctions(func); + if (func) + { + AddToEntryFunctions(func); + } } m_logger->LogDebug("Adding function start: %#" PRIx64 "\n", entry); -- cgit v1.3.1