summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-02-26 17:17:07 +0100
committerMark Wielaard <[email protected]>2014-02-26 17:18:49 +0100
commit48827ec6cb2169bad15baf7702f86c4bf2847beb (patch)
tree3f055e28ae298bf89260c492b947053741873665 /libdwfl
parentcb7b2d64b6fdbbb6f18ce07294b2315f60d843bc (diff)
libdwfl: elf-from-memory.c (elf_from_remote_memory): Check against p64 p_type.
There was a type in the case of parsing ELFCLASS64 phdrs. Check against p64 p_type, not the p32 p_type which at a different location in the union. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/elf-from-memory.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index e55b03b7..aacc0bf2 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2014-02-26 Mark Wielaard <[email protected]>
+
+ * elf-from-memory.c (elf_from_remote_memory): Check against p64
+ p_type in case ELFCLASS64, not against p32 p_type.
+
2014-01-17 Petr Machata <[email protected]>
* relocate.c (relocate_section): Use gelf_fsize instead of relying
diff --git a/libdwfl/elf-from-memory.c b/libdwfl/elf-from-memory.c
index 528c35f4..7d35df6a 100644
--- a/libdwfl/elf-from-memory.c
+++ b/libdwfl/elf-from-memory.c
@@ -301,7 +301,7 @@ elf_from_remote_memory (GElf_Addr ehdr_vma,
case ELFCLASS64:
for (uint_fast16_t i = 0; i < phnum; ++i)
- if (phdrs.p32[i].p_type == PT_LOAD)
+ if (phdrs.p64[i].p_type == PT_LOAD)
if (handle_segment (phdrs.p64[i].p_vaddr, phdrs.p64[i].p_offset,
phdrs.p64[i].p_filesz, phdrs.p64[i].p_align))
goto read_error;