summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorNiko Tyni <ntyni@debian.org>2010-10-28 23:52:17 +0300
committerFather Chrysostomos <sprout@cpan.org>2010-10-29 11:20:40 -0700
commite3393f51d48d8b790e26324eb0336fac9689fa46 (patch)
tree7dac8603683ef41d4131482c3b2b14c739a96893 /pp_hot.c
parent53b7400f0b7822d1dfe39e209c0729821f89ace3 (diff)
downloadperl-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_hot.c b/pp_hot.c
index fd270e9798..f4d79dc5da 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -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);