summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2026-05-27 16:23:05 -0400
committerMason Reed <35282038+emesare@users.noreply.github.com>2026-05-28 14:09:06 -0400
commitb24fcc83e829e3f367b88b507daf23e57bce66c2 (patch)
treea52b76ca1804dacdb8b1faf2c98df4b3f6ccd49b
parent1349246757ec6d7002407c2f89e40819293156e8 (diff)
[ELF] Fix MIPS symbol lookup hang with malformed symbol table entry
If we hit a got entry outside the valid regions of memory we can safely assume the tables to be malformed.
-rw-r--r--view/elf/elfview.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index c54663d4..d5ff0ef4 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -1154,6 +1154,11 @@ bool ElfView::Init()
for (uint64_t i = firstMipsSym; i < (m_auxSymbolTable.size / (m_elf32 ? 16 : 24)); i++)
{
uint64_t gotEntry = gotStart + ((localMipsSyms + i - firstMipsSym) * (m_elf32 ? 4 : 8));
+ if (!IsValidOffset(gotEntry))
+ {
+ m_logger->LogWarn("ELF GOT entry %" PRIx64 " is invalid", gotEntry);
+ break;
+ }
ElfSymbolTableEntry entry;
if (!ParseSymbolTableEntry(virtualReader, entry, i, m_auxSymbolTable, m_dynamicStringTable, true))