diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-07 14:34:21 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2021-12-07 14:37:55 -0800 |
commit | 8f3e5e5046055bc00151fe28b50ac438270e23b3 (patch) | |
tree | 8e425da076ba1ed2c28df83e98dae4285af6cdee /lib | |
parent | cdebefdc665ef39bfc1467933b3c2c6a5b74bbe4 (diff) | |
download | gnulib-8f3e5e5046055bc00151fe28b50ac438270e23b3.tar.gz |
regex: pacify Coverity clean_state_log_if_needed
Problem reported by Robbie Harwood in:
https://lists.gnu.org/r/bug-gnulib/2021-12/msg00005.html
* lib/regexec.c (clean_state_log_if_needed):
Add a DEBUG_ASSERT; this both pacifies Coverity and
will help to debug in case some other change mistakenly
causes the assertion to become false.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/regexec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/regexec.c b/lib/regexec.c index 085bf27b09..3196708373 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -1670,6 +1670,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx) if (top < next_state_log_idx) { + DEBUG_ASSERT (mctx->state_log != NULL); memset (mctx->state_log + top + 1, '\0', sizeof (re_dfastate_t *) * (next_state_log_idx - top)); mctx->state_log_top = next_state_log_idx; |