Reported by Coverity.
* lib/regexec.c (re_search_internal): Move initialization of variable
'save_state_log' further up.
+2026-04-13 Bruno Haible <bruno@clisp.org>
+
+ regex: Fix use of uninitialized variable (regression yesterday).
+ Reported by Coverity.
+ * lib/regexec.c (re_search_internal): Move initialization of variable
+ 'save_state_log' further up.
+
2026-04-12 Jim Meyering <meyering@meta.com>
regex: small simplification
/* We must check the longest matching, if nmatch > 0. */
fl_longest_match = (nmatch != 0 || dfa->nbackref);
+ re_dfastate_t **save_state_log = NULL;
+
err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
preg->translate, (preg->syntax & RE_ICASE) != 0,
dfa);
| (t != NULL ? 1 : 0))
: 8);
- re_dfastate_t **save_state_log = NULL;
-
for (;; match_first += incr)
{
err = REG_NOMATCH;