summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-08-05 17:46:46 +0100
committerDavid Mitchell <davem@iabyn.com>2011-08-05 17:49:51 +0100
commit1380b51d3b2bb6a067c4a2a3eebbe18650487023 (patch)
tree77a135c7c65673512544b1487c9b525bc05833a1 /regexec.c
parent203979cd3f6e5fc2c4039fbd225bbbc4c1bb8f84 (diff)
downloadperl-1380b51d3b2bb6a067c4a2a3eebbe18650487023.tar.gz
RT #96354: \h \H \v and \V didn't check for EOL
The HORIZWS and similar regexp ops didn't check that the end of the string had been reached; therefore they would blithely compare against the \0 at the end of the string, or beyond.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/regexec.c b/regexec.c
index 76c91af1f7..bdd5e3faed 100644
--- a/regexec.c
+++ b/regexec.c
@@ -5683,6 +5683,8 @@ NULL
#define CASE_CLASS(nAmE) \
case nAmE: \
+ if (locinput >= PL_regeol) \
+ sayNO; \
if ((n=is_##nAmE(locinput,utf8_target))) { \
locinput += n; \
nextchr = UCHARAT(locinput); \
@@ -5690,6 +5692,8 @@ NULL
sayNO; \
break; \
case N##nAmE: \
+ if (locinput >= PL_regeol) \
+ sayNO; \
if ((n=is_##nAmE(locinput,utf8_target))) { \
sayNO; \
} else { \