summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2013-06-01 11:10:39 +1000
committerTony Cook <tony@develop-help.com>2013-06-03 22:05:27 +1000
commit9597860a6bc546628ff50b88916291944416e77f (patch)
treeae8e55a1b24ec526a4235791da6272814bd25419 /regexec.c
parent0430522fe9e09f2129cdb8268ddd1ca1a36e6a5f (diff)
downloadperl-9597860a6bc546628ff50b88916291944416e77f.tar.gz
[perl #118175] prevent a similar overflow for CANY
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index 1b3e7760ca..87a0d7317a 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6705,7 +6705,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
scan = loceol;
break;
case CANY: /* Move <scan> forward <max> bytes, unless goes off end */
- if (utf8_target && scan + max < loceol) {
+ if (utf8_target && loceol - scan > max) {
/* <loceol> hadn't been adjusted in the UTF-8 case */
scan += max;