From: Mark Wielaard Date: Mon, 18 Dec 2017 11:39:13 +0000 (+0100) Subject: readelf: Try to continue after encountering bogus ELF Note data. X-Git-Tag: elfutils-0.171~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8887f30e55747b010631f04c4dc5f513359213f4;p=thirdparty%2Felfutils.git readelf: Try to continue after encountering bogus ELF Note data. There might be other sections or segments with ELF Notes that are readable. Also adjust error message depending on whether or not we actually got any data for the ELF Note segment or section. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 8935022be..994b1e17b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2017-12-18 Mark Wielaard + + * readelf.c (handle_notes_data): Don't use EXIT_FAILURE in error. + Adjust error message depending on whether or not we got data. + 2017-12-07 Mark Wielaard * readelf.c (print_ops): Update data pointer and print arguments diff --git a/src/readelf.c b/src/readelf.c index ed21ef7ac..ca979e3c6 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -9611,9 +9611,9 @@ handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr, return; bad_note: - error (EXIT_FAILURE, 0, - gettext ("cannot get content of note section: %s"), - elf_errmsg (-1)); + error (0, 0, + gettext ("cannot get content of note: %s"), + data != NULL ? "garbage data" : elf_errmsg (-1)); } static void