X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=regcomp.c;h=80e5cfbf3d7edb57498209722e47576ba0af2139;hb=773b30b9d40ef0a7f9346541b7eabb9a1a82fef1;hp=dedcd0079d16b3ab0c87140827982f3595b0e96b;hpb=6b43b21664ab964e1ebd0bc1810512bd8e137c12;p=p5sagit%2Fp5-mst-13.2.git diff --git a/regcomp.c b/regcomp.c index dedcd00..80e5cfb 100644 --- a/regcomp.c +++ b/regcomp.c @@ -4272,8 +4272,11 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state) for (;;) { if (*RExC_parse == '(' && RExC_parse[1] == '?' && RExC_parse[2] == '#') { - while (*RExC_parse && *RExC_parse != ')') + while (*RExC_parse != ')') { + if (RExC_parse == RExC_end) + FAIL("Sequence (?#... not terminated"); RExC_parse++; + } RExC_parse++; continue; } @@ -4283,9 +4286,8 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state) continue; } else if (*RExC_parse == '#') { - while (*RExC_parse && *RExC_parse != '\n') - RExC_parse++; - RExC_parse++; + while (RExC_parse < RExC_end) + if (*RExC_parse++ == '\n') break; continue; } }