summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-30 22:08:43 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-30 22:09:05 -0700
commit864329c3a6aadf41283abada71c1b343e164bad3 (patch)
tree2a3773a72bde927a360555f3ff9b2d670ea30247 /pp.c
parent7d1328bb7c26d556809b1aed184cec377b18f20c (diff)
downloadperl-864329c3a6aadf41283abada71c1b343e164bad3.tar.gz
Stop substr($utf8) from calling get-magic twice
By calling get-magic twice, it could cause its string buffer to be reallocated, resulting in incorrect and random return values.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 0c148baf2b..05a9edf482 100644
--- a/pp.c
+++ b/pp.c
@@ -3020,7 +3020,7 @@ PP(pp_substr)
}
tmps = SvPV_const(sv, curlen);
if (DO_UTF8(sv)) {
- utf8_curlen = sv_len_utf8(sv);
+ utf8_curlen = sv_len_utf8_nomg(sv);
if (utf8_curlen == curlen)
utf8_curlen = 0;
else