]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf: Handle NULL shdr in section_name
authorMark Wielaard <mark@klomp.org>
Thu, 6 Apr 2023 14:58:13 +0000 (16:58 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 14 Apr 2023 15:25:03 +0000 (17:25 +0200)
commitd8d1900ace46542e0fd4e0cec8af2324166109e4
treec007d77bb2161299825ea1a6397c8d817f1f1416
parent3daddabd5d619bc2316813a5676d9be34ad3f6ac
readelf: Handle NULL shdr in section_name

In some error cases we want to show the section name but cannot
because the section header is corrupt or NULL. Make sure the
section_name always returns "???" in that case.

* src/readelf.c (section_name): Check for shdr == NULL.

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