summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2014-03-12 14:11:58 -0600
committerKarl Williamson <public@khwilliamson.com>2014-03-12 14:32:36 -0600
commit8842e230bdaeef0ab4af48b7d7a9b29ee40b3890 (patch)
treebf7aae8012cfb9fd7c9072bedf942f3a18463df2 /regcomp.c
parent5d9574c10ca04dcefc1cac5441cb321f7bb4cc37 (diff)
downloadperl-8842e230bdaeef0ab4af48b7d7a9b29ee40b3890.tar.gz
regcomp.c: Don't read past string-end
In doing an audit of regcomp.c, and experimenting using Encode::_utf8_on(), I found this one instance of a regen/regcharclass.pl macro that could read beyond the end of the string if given malformed UTF-8. Hence we convert to use the 'safe' form. There are no other uses of the non-safe version, so don't need to generate them.
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index d72d3441bf..ca2ffb8d48 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -11920,7 +11920,7 @@ tryagain:
if (! SIZE_ONLY
&& RExC_flags & RXf_PMf_EXTENDED
&& ckWARN_d(WARN_DEPRECATED)
- && is_PATWS_non_low(p, UTF))
+ && is_PATWS_non_low_safe(p, RExC_end, UTF))
{
vWARN_dep(p + ((UTF) ? UTF8SKIP(p) : 1),
"Escape literal pattern white space under /x");