]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elflint: Explicitly check and ignore elf_compress error.
authorMark Wielaard <mark@klomp.org>
Tue, 16 Jun 2020 16:14:37 +0000 (18:14 +0200)
committerMark Wielaard <mark@klomp.org>
Fri, 19 Jun 2020 13:48:05 +0000 (15:48 +0200)
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 <mark@klomp.org>
src/ChangeLog
src/elflint.c

index 512d7b542a697f55c93250face18c6ba576789da..e78bc3582afbcaa8c51137b0c638eb68a754eac1 100644 (file)
@@ -1,3 +1,8 @@
+2020-06-16  Mark Wielaard  <mark@klomp.org>
+
+       * elflint.c (check_elf_header): Explicitly check and ignore
+       any error from elf_compress.
+
 2020-06-07  Mark Wielaard  <mark@klomp.org>
 
        * nm.c (sort_by_name_strtab): Replace by...
index 72584de0176c557b8bac93721ac0729329e3466c..9cdccccae812967ae05d9ba4d4b7fd16c6129059 100644 (file)
@@ -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);