Skip to content

Commit a1fcbed

Browse files
committed
regexec: assert we stay in bounds when matching \b{wb}
Coverity (CID 550207) complains that the loop condition only ensures 'index' stays in bounds of WB_dfa_table, not 'index+1'. I don't think the data in the table lets us go out of bounds here, but it doesn't hurt to assert() that assumption.
1 parent 1b4a1a9 commit a1fcbed

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

regexec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6273,6 +6273,7 @@ S_isWB(pTHX_ WB_enum previous,
62736273
/* Here 'matched' is true if the DFA matched the input. If so,
62746274
* [index+1] contains the value to return */
62756275
if (matched) {
6276+
assert(index+1 < C_ARRAY_LENGTH(WB_dfa_table));
62766277
return WB_dfa_table[index+1];
62776278
}
62786279

0 commit comments

Comments
 (0)