summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-03-04 13:14:30 -0700
committerKarl Williamson <khw@cpan.org>2016-03-04 13:24:20 -0700
commitca76e4e9adfa1629d8fee4608cbeab9d9ba91ed3 (patch)
tree7ab17c5d98d2d38719e0b224724ee0747d93ed86 /regcomp.c
parent88474c07fbd1a35a58cf4b0d6a0665044ecdb7fb (diff)
downloadperl-ca76e4e9adfa1629d8fee4608cbeab9d9ba91ed3.tar.gz
PATCH: [perl #126141]: qr/]]]]][\\/ fails to raise error
This was due to the trailing \ trying to look at the next character without verifying that one actually existed.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/regcomp.c b/regcomp.c
index 9b63fef168..68c599f118 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -15718,6 +15718,11 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth,
}
else if (value == '\\') {
/* Is a backslash; get the code point of the char after it */
+
+ if (RExC_parse >= RExC_end) {
+ vFAIL("Unmatched [");
+ }
+
if (UTF && ! UTF8_IS_INVARIANT(UCHARAT(RExC_parse))) {
value = utf8n_to_uvchr((U8*)RExC_parse,
RExC_end - RExC_parse,