From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0818919327666934173==" MIME-Version: 1.0 From: Petr Machata To: elfutils-devel@lists.fedorahosted.org Subject: [PATCH] readelf: Fix typo in a check in handle_relocs_rela Date: Sun, 14 Sep 2014 01:03:19 +0200 Message-ID: --===============0818919327666934173== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable - 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 --- src/ChangeLog | 4 ++++ src/readelf.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index aa98608..a252cdc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2014-09-14 Petr Machata + + * readelf.c (handle_relocs_rela): Typo fix, test DESTSHDR properly. + 2014-09-12 Petr Machata = * readelf.c (encoded_ptr_size): In the switch statement, change diff --git a/src/readelf.c b/src/readelf.c index 7b43a65..4d3bb36 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -2090,7 +2090,7 @@ handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Sc= n *scn, GElf_Shdr *shdr) ? xndx : sym->st_shndx), &destshdr_mem); = - if (unlikely (shdr =3D=3D NULL)) + if (unlikely (destshdr =3D=3D NULL)) printf (" %#0*" PRIx64 " %-15s <%s %ld>\n", class =3D=3D ELFCLASS32 ? 10 : 18, rel->r_offset, ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info)) -- = 1.7.6.5 --===============0818919327666934173==--