]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
readelf: Fix typo in a check in handle_relocs_rela
authorPetr Machata <pmachata@redhat.com>
Sat, 13 Sep 2014 22:47:42 +0000 (00:47 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 23 Sep 2014 13:06:09 +0000 (15:06 +0200)
- Testing shdr makes no sense, that pointer was dereferenced several
  times throughout the section.  destshdr on the other hand is not
  tested at all.

Signed-off-by: Petr Machata <pmachata@redhat.com>
src/ChangeLog
src/readelf.c

index aa986080ccf63665c47e0ba1e4508d7038fe64c6..a252cdcdce6c6d2497abf936100ec482204519d3 100644 (file)
@@ -1,3 +1,7 @@
+2014-09-14  Petr Machata  <pmachata@redhat.com>
+
+       * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly.
+
 2014-09-12  Petr Machata  <pmachata@redhat.com>
 
        * readelf.c (encoded_ptr_size): In the switch statement, change
index 7b43a658601801d4de98a5c9ebc311cde700c2f5..4d3bb36306447f8e679764667497b4ea32c28ccb 100644 (file)
@@ -2090,7 +2090,7 @@ handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
                                                   ? xndx : sym->st_shndx),
                                       &destshdr_mem);
 
-             if (unlikely (shdr == NULL))
+             if (unlikely (destshdr == NULL))
                printf ("  %#0*" PRIx64 "  %-15s <%s %ld>\n",
                        class == ELFCLASS32 ? 10 : 18, rel->r_offset,
                        ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))