From: Mark Wielaard Date: Wed, 26 Feb 2014 16:17:07 +0000 (+0100) Subject: libdwfl: elf-from-memory.c (elf_from_remote_memory): Check against p64 p_type. X-Git-Tag: elfutils-0.159~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=48827ec6cb2169bad15baf7702f86c4bf2847beb;p=thirdparty%2Felfutils.git 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 --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index e55b03b75..aacc0bf2a 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,8 @@ +2014-02-26 Mark Wielaard + + * 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 * 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 528c35f41..7d35df6ab 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;