From: Darren Kenny <darren.ke...@oracle.com> 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.ke...@oracle.com> Reviewed-by: Daniel Kiper <daniel.ki...@oracle.com> Signed-off-by: Robbie Harwood <rharw...@redhat.com> --- lib/regexec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/regexec.c b/lib/regexec.c index e48fe5333..90330ef39 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -815,7 +815,11 @@ re_search_internal (const regex_t *preg, const char *string, Idx length, 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. */ -- 2.33.0