]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: elf-from-memory.c (elf_from_remote_memory): Check against p64 p_type.
authorMark Wielaard <mjw@redhat.com>
Wed, 26 Feb 2014 16:17:07 +0000 (17:17 +0100)
committerMark Wielaard <mjw@redhat.com>
Wed, 26 Feb 2014 16:18:49 +0000 (17:18 +0100)
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 <mjw@redhat.com>
libdwfl/ChangeLog
libdwfl/elf-from-memory.c

index e55b03b75ffb3ca5ce3d33cb479f59111346f48a..aacc0bf2a60f7b31ba1bf07f4bf205368c631757 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-26  Mark Wielaard  <mjw@redhat.com>
+
+       * 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  <pmachata@redhat.com>
 
        * relocate.c (relocate_section): Use gelf_fsize instead of relying
index 528c35f41e22559478491a21f02f4c67ae24da6b..7d35df6ab9cd19b32e745c6fc36d32bc572618c5 100644 (file)
@@ -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;