summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-08-16 15:16:09 -0400
committerJosh Ferrell <josh@vector35.com>2024-08-16 15:16:09 -0400
commit086342aedfa97ff207d0c8e1993bf0ebff8a519a (patch)
treefdcb88403cf8a0cd2bc758cabc4a975325a14ad1
parent385f2fa00e829aea8ec3ebb765785eeb2cbb5ca0 (diff)
Prevent reading past end of dynamic table
-rw-r--r--view/elf/elfview.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp
index f4a089bd..801adf76 100644
--- a/view/elf/elfview.cpp
+++ b/view/elf/elfview.cpp
@@ -795,6 +795,13 @@ bool ElfView::Init()
while (!end)
{
uint64_t tag, value;
+ if (i >= m_dynamicTable.fileSize)
+ {
+ // Prevent reading past end of dynamic table in file
+ end = true;
+ break;
+ }
+
if (m_elf32) // 32-bit ELF
{
tag = reader.Read32();