diff options
author | Tony Cook <tony@develop-help.com> | 2013-06-01 12:33:05 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2013-06-03 22:05:27 +1000 |
commit | dfb8f192c83f98bba59d4a8c282ee4cf5bfca8a9 (patch) | |
tree | f3ad54ac0121ff802b04e85171df9820f18c4114 /regexec.c | |
parent | 9597860a6bc546628ff50b88916291944416e77f (diff) | |
download | perl-dfb8f192c83f98bba59d4a8c282ee4cf5bfca8a9.tar.gz |
[perl #118175] avoid making a pointer outside a string
Simply adding scan + max causes undefined behaviour per ANSI C if the
result points outside of the object scan points at.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -6656,7 +6656,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p, scan = *startposp; if (max == REG_INFTY) max = I32_MAX; - else if (! utf8_target && scan + max < loceol) + else if (! utf8_target && loceol - scan > max) loceol = scan + max; /* Here, for the case of a non-UTF-8 target we have adjusted <loceol> down |