diff options
Diffstat (limited to 'meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/concat-stack-corruption.diff')
-rw-r--r-- | meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/concat-stack-corruption.diff | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/concat-stack-corruption.diff b/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/concat-stack-corruption.diff new file mode 100644 index 0000000000..6feb8401fe --- /dev/null +++ b/meta/recipes-devtools/perl/perl-5.12.2/debian/fixes/concat-stack-corruption.diff | |||
@@ -0,0 +1,37 @@ | |||
1 | From: Niko Tyni <ntyni@debian.org> | ||
2 | Subject: Fix stack pointer corruption in pp_concat() with 'use encoding' | ||
3 | Bug-Debian: http://bugs.debian.org/596105 | ||
4 | Bug: http://rt.perl.org/rt3/Ticket/Display.html?id=78674 | ||
5 | Origin: upstream, http://perl5.git.perl.org/perl.git/commit/e3393f51d48d8b790e26324eb0336fac9689fa46 | ||
6 | |||
7 | If the stack is reallocated during pp_concat() and 'use encoding' in | ||
8 | effect, the stack pointer gets corrupted, causing memory allocation bugs | ||
9 | and the like. | ||
10 | |||
11 | --- | ||
12 | pp_hot.c | 3 +++ | ||
13 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
14 | |||
15 | diff --git a/pp_hot.c b/pp_hot.c | ||
16 | index 3371e88..e9cccf3 100644 | ||
17 | --- a/pp_hot.c | ||
18 | +++ b/pp_hot.c | ||
19 | @@ -271,6 +271,8 @@ PP(pp_concat) | ||
20 | rbyte = !DO_UTF8(right); | ||
21 | } | ||
22 | if (lbyte != rbyte) { | ||
23 | + /* sv_utf8_upgrade_nomg() may reallocate the stack */ | ||
24 | + PUTBACK; | ||
25 | if (lbyte) | ||
26 | sv_utf8_upgrade_nomg(TARG); | ||
27 | else { | ||
28 | @@ -279,6 +281,7 @@ PP(pp_concat) | ||
29 | sv_utf8_upgrade_nomg(right); | ||
30 | rpv = SvPV_const(right, rlen); | ||
31 | } | ||
32 | + SPAGAIN; | ||
33 | } | ||
34 | sv_catpvn_nomg(TARG, rpv, rlen); | ||
35 | |||
36 | -- | ||
37 | tg: (c823880..) fixes/concat-stack-corruption (depends on: upstream) | ||