From: Dave Mitchell Date: Sat, 20 May 2006 00:43:42 +0000 (+0000) Subject: [perl #32041] SEGV with complicated regexp and long string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66bf836d545d4a639166fad46f83811d0df5f8ce;p=p5sagit%2Fp5-mst-13.2.git [perl #32041] SEGV with complicated regexp and long string PL_reg_maxiter was wrapping to a negative value p4raw-id: //depot/perl@28248 --- diff --git a/regexec.c b/regexec.c index f765024..0f5d6fb 100644 --- a/regexec.c +++ b/regexec.c @@ -3652,6 +3652,9 @@ S_regmatch(pTHX_ const regmatch_info *reginfo, regnode *prog) *that* much linear. */ if (!PL_reg_maxiter) { PL_reg_maxiter = (PL_regeol - PL_bostr + 1) * (scan->flags>>4); + /* possible overflow for long strings and many CURLYX's */ + if (PL_reg_maxiter < 0) + PL_reg_maxiter = I32_MAX; PL_reg_leftiter = PL_reg_maxiter; } if (PL_reg_leftiter-- == 0) {