summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 7e1e6bd6d5..53b1698a47 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -3193,6 +3193,8 @@ tryagain:
s += numlen;
len += numlen;
foldbuf += numlen;
+ if (numlen >= foldlen)
+ break;
}
else
break; /* "Can't happen." */
@@ -3221,9 +3223,11 @@ tryagain:
ender = utf8_to_uvchr(foldbuf, &numlen);
if (numlen > 0) {
reguni(pRExC_state, ender, s, &numlen);
- s += numlen;
len += numlen;
+ s += numlen;
foldbuf += numlen;
+ if (numlen >= foldlen)
+ break;
}
else
break;