summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2013-05-28 20:43:28 +1000
committerTony Cook <tony@develop-help.com>2013-06-03 22:05:27 +1000
commite93698247608fc5e325f579722e45f4278eccc3c (patch)
tree1d2deae5d57a605fc40aba56ec81a9eb8529b24b /regexec.c
parentaad042978d66db81c18ecc36f46bd4b27dd980e0 (diff)
downloadperl-e93698247608fc5e325f579722e45f4278eccc3c.tar.gz
[perl #118175] avoid overflowing a pointer for repeated EXACT nodes
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 4fc9444c4e..c39b9f69b5 100644
--- a/regexec.c
+++ b/regexec.c
@@ -6724,7 +6724,7 @@ S_regrepeat(pTHX_ regexp *prog, char **startposp, const regnode *p,
* can use UTF8_IS_INVARIANT() even if the pattern isn't UTF-8, as it's
* true iff it doesn't matter if the argument is in UTF-8 or not */
if (UTF8_IS_INVARIANT(c) || (! utf8_target && ! reginfo->is_utf8_pat)) {
- if (utf8_target && scan + max < loceol) {
+ if (utf8_target && loceol - scan > max) {
/* We didn't adjust <loceol> because is UTF-8, but ok to do so,
* since here, to match at all, 1 char == 1 byte */
loceol = scan + max;