From: Mark Wielaard Date: Tue, 16 Jun 2020 16:14:37 +0000 (+0200) Subject: elflint: Explicitly check and ignore elf_compress error. X-Git-Tag: elfutils-0.181~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ba91e83e2b6b1e062e5c7ff8ab2d26e276f2987;p=thirdparty%2Felfutils.git elflint: Explicitly check and ignore elf_compress error. We just want to make sure that any section data is decompressed before use, if the section was already decompressed that is fine, so just ignore any errors. The make this more clear, explicitly check for errors, then don't do anything. This is better than silently ignoring since everywhere else in the code we do explicitly check for errors. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index 512d7b542..e78bc3582 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2020-06-16 Mark Wielaard + + * elflint.c (check_elf_header): Explicitly check and ignore + any error from elf_compress. + 2020-06-07 Mark Wielaard * nm.c (sort_by_name_strtab): Replace by... diff --git a/src/elflint.c b/src/elflint.c index 72584de01..9cdccccae 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -467,7 +467,7 @@ invalid number of section header table entries\n")); break; /* If the section wasn't compressed this does nothing, but returns an error. We don't care. */ - elf_compress (scn, 0, 0); + if (elf_compress (scn, 0, 0) < 0) { ; } } if (scnt < shnum) ERROR (gettext ("Can only check %u headers, shnum was %u\n"), scnt, shnum);