summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-08-26 11:11:07 +0300
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-26 05:18:15 +0000
commite994fd663a4d8acc8c717fa28479d849341d1bb4 (patch)
tree5ce0bae519b646c868fa25a6fb71d9885a19e0af /regcomp.c
parent397cf4b72b64bab2d81c27006b39549ca667b5a8 (diff)
downloadperl-e994fd663a4d8acc8c717fa28479d849341d1bb4.tar.gz
Re: [PATCH] valgrind and /#/x
Message-ID: <20030826051107.GA1086@ratsnest.hole> p4raw-id: //depot/perl@20901
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/regcomp.c b/regcomp.c
index 556922a1ba..80e5cfbf3d 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,10 +4286,8 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state)
continue;
}
else if (*RExC_parse == '#') {
- while (*RExC_parse && *RExC_parse != '\n')
- RExC_parse++;
- if (*RExC_parse)
- RExC_parse++;
+ while (RExC_parse < RExC_end)
+ if (*RExC_parse++ == '\n') break;
continue;
}
}