grub2/grub-core/lib/gnulib-patches/fix-unused-value.patch
Darren Kenny a983d36bd9 gnulib/regexec: Resolve unused variable
This is a really minor issue where a variable is being assigned to but
not checked before it is overwritten again.

The reason for this issue is that we are not building with DEBUG set and
this in turn means that the assert() that reads the value of the
variable match_last is being processed out.

The solution, move the assignment to match_last in to an ifdef DEBUG too.

Fixes: CID 292459

Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2021-03-02 15:54:16 +01:00

15 lines
441 B
Diff

--- 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. */