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