diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-08-30 22:08:43 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-08-30 22:09:05 -0700 |
commit | 864329c3a6aadf41283abada71c1b343e164bad3 (patch) | |
tree | 2a3773a72bde927a360555f3ff9b2d670ea30247 /pp.c | |
parent | 7d1328bb7c26d556809b1aed184cec377b18f20c (diff) | |
download | perl-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |