diff options
author | Petr Machata <pmachata@redhat.com> | 2014-09-14 00:47:42 +0200 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2014-09-23 15:06:09 +0200 |
commit | fbf1a44f0f2ccda6a3f725ebb8ae723e0e607d8b (patch) | |
tree | 90dd1342d490f0475f0dd9f15c787c740a7a7cc4 | |
parent | 6097c00a539873e9baa22e10f9387b9c36c4fa25 (diff) | |
download | elfutils-fbf1a44f0f2ccda6a3f725ebb8ae723e0e607d8b.tar.gz |
readelf: Fix typo in a check in handle_relocs_rela
- 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>
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/readelf.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index aa986080..a252cdcd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/readelf.c b/src/readelf.c index 7b43a658..4d3bb363 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -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)) |