Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 99264
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: TONYC [...] cpan.org
Cc: pali [...] cpan.org
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: call_pv() can reallocate the stack, but Member_mime_name() continues to use the old stack
This is causing the crash in https://rt.perl.org/Ticket/Display.html?id=122873 I've attached a fix. This is also available as https://github.com/dankogai/p5-encode/pull/23 Tony
Subject: 0001-SPAGAIN-after-call_pv-which-can-reallocate-the-perl-.patch
From 5f0737ab20b7bd46cddaccdfff5a6f78b73f19e1 Mon Sep 17 00:00:00 2001 From: Tony Cook <tony@develop-help.com> Date: Thu, 2 Oct 2014 11:05:03 +1000 Subject: [PATCH] SPAGAIN after call_pv(), which can reallocate the perl stack --- Encode.xs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Encode.xs b/Encode.xs index 5ee4539..5e20c3d 100644 --- a/Encode.xs +++ b/Encode.xs @@ -686,6 +686,7 @@ CODE: /* require_pv(PERLIO_FILENAME); */ eval_pv("require PerlIO::encoding", 0); + SPAGAIN; if (SvTRUE(get_sv("@", 0))) { ST(0) = &PL_sv_no; @@ -703,6 +704,7 @@ CODE: encode_t *enc = INT2PTR(encode_t *, SvIV(SvRV(obj))); SV *retval; eval_pv("require Encode::MIME::Name", 0); + SPAGAIN; if (SvTRUE(get_sv("@", 0))) { ST(0) = &PL_sv_undef; -- 1.7.10.4
On Wed Oct 01 21:14:23 2014, TONYC wrote: Show quoted text
> This is causing the crash in > https://rt.perl.org/Ticket/Display.html?id=122873 > > I've attached a fix. This is also available as > https://github.com/dankogai/p5-encode/pull/23 > > Tony
Thanks, applied. https://github.com/dankogai/p5-encode/commit/c2b2772d2d14724d16baa0ca0cb16eca7a48a38e Dan the Maintainer Thereof
This bug is fixed, so please close it.