Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 8e11a66

Browse files
committed
Fix #293 DEBUGGING regex stack recursion overflow
This is a critical regression since 5.26, but thanksfully only with DEBUGGING. Before or without DEBUGGING it failed with the somewhat unhelpful error message "Unmatched ( in regex", now with more than 5000 open parens do the same. Fixes id:000001,sig:11,src:017300+020757,op:splice,rep:64-minimized, Closes #293
1 parent d7abc28 commit 8e11a66

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

regcomp.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -10627,7 +10627,11 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth)
1062710627
* indivisible */
1062810628
bool has_intervening_patws = paren == 2 && *(RExC_parse - 1) != '(';
1062910629

10630-
if (RExC_parse >= RExC_end) {
10630+
if (RExC_parse >= RExC_end
10631+
#ifdef DEBUGGING
10632+
|| depth > 5000 /* Only with DEBUGGING */
10633+
#endif
10634+
) {
1063110635
vFAIL("Unmatched (");
1063210636
}
1063310637

0 commit comments

Comments
 (0)