]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf: Skip trying to uncompress sections without a name
authorMark Wielaard <mark@klomp.org>
Sat, 8 Feb 2025 23:07:39 +0000 (00:07 +0100)
committerMark Wielaard <mark@klomp.org>
Fri, 14 Feb 2025 07:55:10 +0000 (08:55 +0100)
commit73db9d2021cab9e23fd734b0a76a612d52a6f1db
treee9890494973df6603db561b3e34417acb1215f46
parentb38e562a4c907e08171c76b8b2def8464d5a104a
readelf: Skip trying to uncompress sections without a name

When combining eu-readelf -z with -x or -p to dump the data or strings
in an (corrupted ELF) unnamed numbered section eu-readelf could crash
trying to check whether the section name starts with .zdebug. Fix this
by skipping sections without a name.

   * src/readelf.c (dump_data_section): Don't try to gnu decompress a
   section without a name.
   (print_string_section): Likewise.

https://sourceware.org/bugzilla/show_bug.cgi?id=32656

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/readelf.c