]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gnulib: Bring back the fix for resolving unused variable issue
authorLidong Chen <lidong.chen@oracle.com>
Thu, 26 Jun 2025 15:05:01 +0000 (17:05 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 15:19:25 +0000 (17:19 +0200)
This patch resolved a minor issue spotted by Coverity:
  a983d36bd917 (gnulib/regexec: Resolve unused variable)

But, it was removed by the Gnulib update:
  2b7902459803 (Update gnulib version and drop most gnulib patches)

It caused Coverity to continue to flag the issue. Daniel Kiper
suggested to bring back the patch a983d36bd917 (gnulib/regexec: Resolve
unused variable).

Fixes: CID 292459
Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
bootstrap.conf
conf/Makefile.extra-dist
grub-core/lib/gnulib-patches/fix-unused-value.patch [new file with mode: 0644]

index 5717b7109a3dc02bb9fb5b2b199afacc670a479b..3590aba996dfba7df9c73ad037fcb78981902f17 100644 (file)
@@ -87,7 +87,8 @@ bootstrap_post_import_hook () {
   for patchname in fix-width \
       fix-regcomp-resource-leak \
       fix-regexec-resource-leak \
-      fix-gcc-15-compile; do
+      fix-gcc-15-compile \
+      fix-unused-value; do
     patch -d grub-core/lib/gnulib -p2 \
        < "grub-core/lib/gnulib-patches/$patchname.patch"
   done
index 869e3a16c5090299426ae5a266e1203edd9abf9a..f4e3c5fbac0fc78bd26cb62361403f7f6df60c84 100644 (file)
@@ -32,6 +32,7 @@ EXTRA_DIST += grub-core/lib/gnulib-patches/fix-width.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regcomp-resource-leak.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-regexec-resource-leak.patch
 EXTRA_DIST += grub-core/lib/gnulib-patches/fix-gcc-15-compile.patch
+EXTRA_DIST += grub-core/lib/gnulib-patches/fix-unused-value.patch
 
 EXTRA_DIST += grub-core/lib/libgcrypt
 EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
diff --git a/grub-core/lib/gnulib-patches/fix-unused-value.patch b/grub-core/lib/gnulib-patches/fix-unused-value.patch
new file mode 100644 (file)
index 0000000..ba51f1b
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/lib/regexec.c    2020-10-21 14:25:35.310195912 +0000
++++ b/lib/regexec.c    2020-10-21 14:32:07.961765604 +0000
+@@ -828,7 +828,11 @@
+                   break;
+                 if (__glibc_unlikely (err != REG_NOMATCH))
+                   goto free_return;
++#ifdef DEBUG
++                /* Only used for assertion below when DEBUG is set, otherwise
++                   it will be over-written when we loop around.  */
+                 match_last = -1;
++#endif
+               }
+             else
+               break; /* We found a match.  */