summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/regexec.c b/regexec.c
index 3aed549382..0f738d1b27 100644
--- a/regexec.c
+++ b/regexec.c
@@ -995,7 +995,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
c = utf8_to_uvchr((U8*)s, &len);
if ( c == c1
&& (ln == len ||
- !ibcmp_utf8(s, do_utf8, strend - s,
+ !ibcmp_utf8(s, do_utf8,
+ strend - s > ln ? ln : strend - s,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1007,7 +1008,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- do_utf8, foldlen,
+ do_utf8,
+ foldlen > ln ? ln : foldlen,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1032,7 +1034,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
if ( (c == c1 || c == c2)
&& (ln == len ||
- !ibcmp_utf8(s, do_utf8, strend - s,
+ !ibcmp_utf8(s, do_utf8,
+ strend - s > ln ? ln : strend - s,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;
@@ -1044,7 +1047,8 @@ S_find_byclass(pTHX_ regexp * prog, regnode *c, char *s, char *strend, char *sta
&& (f == c1 || f == c2)
&& (ln == foldlen ||
!ibcmp_utf8((char *)foldbuf,
- do_utf8, foldlen,
+ do_utf8,
+ foldlen > ln ? ln : foldlen,
m, UTF, ln))
&& (norun || regtry(prog, s)) )
goto got_it;