diff options
author | Niko Tyni <ntyni@debian.org> | 2010-10-28 23:52:17 +0300 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-29 11:20:40 -0700 |
commit | e3393f51d48d8b790e26324eb0336fac9689fa46 (patch) | |
tree | 7dac8603683ef41d4131482c3b2b14c739a96893 /pp_hot.c | |
parent | 53b7400f0b7822d1dfe39e209c0729821f89ace3 (diff) | |
download | perl-e3393f51d48d8b790e26324eb0336fac9689fa46.tar.gz |
[perl #78674] Fix stack pointer corruption in pp_concat() with 'use encoding'
sv_utf8_upgrade_nomg() may reallocate the stack via sv_recode_to_utf8()
if 'use encoding' is in effect, causing stack pointer corruption.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -275,6 +275,8 @@ PP(pp_concat) rbyte = !DO_UTF8(right); } if (lbyte != rbyte) { + /* sv_utf8_upgrade_nomg() may reallocate the stack */ + PUTBACK; if (lbyte) sv_utf8_upgrade_nomg(TARG); else { @@ -283,6 +285,7 @@ PP(pp_concat) sv_utf8_upgrade_nomg(right); rpv = SvPV_nomg_const(right, rlen); } + SPAGAIN; } sv_catpvn_nomg(TARG, rpv, rlen); |