Skip to contentSkip to conversation

gnulib: Bring back the fix for resolving unused variable

PATCH In review Lidong Chen via Grub-devel 1 participant 2 messages Jun 18, 2025 – Jun 23, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gnulib: Bring back the fix for resolving unused variable

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 sugguested to bring back the patch (sha-a983d36bd917).

---
 bootstrap.conf                                     |  3 ++-
 conf/Makefile.extra-dist                           |  1 +
 .../lib/gnulib-patches/fix-unused-value.patch      | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 grub-core/lib/gnulib-patches/fix-unused-value.patch
bootstrap.conf +2 -1
index 7cd375ba9..7ec868740 100644
@@ -86,7 +86,8 @@ bootstrap_post_import_hook () {
   # add new patches here.
   for patchname in fix-width \
       fix-regcomp-resource-leak \
-      fix-regexec-resource-leak; do
+      fix-regexec-resource-leak \
+      fix-unused-value; do
     patch -d grub-core/lib/gnulib -p2 \
        < "grub-core/lib/gnulib-patches/$patchname.patch"
   done
conf/Makefile.extra-dist +1 -0
index f59b8d8b3..902162212 100644
@@ -31,6 +31,7 @@ EXTRA_DIST += grub-core/genemuinitheader.sh
 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-unused-value.patch
 
 EXTRA_DIST += grub-core/lib/libgcrypt
 EXTRA_DIST += grub-core/lib/libgcrypt-grub/mpi/generic
grub-core/lib/gnulib-patches/fix-unused-value.patch new file +14 -0
new file mode 100644
index 000000000..ba51f1bf2
@@ -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.  */
Signature · 7 lines
2.43.5


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
author Reviewed-by Daniel Kiper on v1 1/2
#1 lore raw
Quoted 10 lines · Lidong Chen

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 sugguested to bring back the patch (sha-a983d36bd917).

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel