Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

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

People
Owner: DANKOGAI [...] cpan.org
Requestors: slaven [...] rezic.de
Cc:
AdminCc:

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



Subject: Segfault with from_to
Download (untitled) / with headers
text/plain 744b
The following code snippet causes a core dump or probably an internal perl panic: panic: sv_setpvn called with negative strlen at /usr/local/lib/perl5/5.8.0/i686-linux/Encode.pm line 184. use Encode qw(from_to); $value = bless {}, 'Bla'; Encode::from_to($value, "utf8", "iso-8859-1", Encode::FB_QUIET); It seems to me that using SvEND causes this fatal error. For non PV scalars, SvEND has no meaning. So fixes could be: * all encode methods could croak for scalars not containing a PV (or for scalars which do not contain a PV after applying SvPV on them) or * check whether the scalar has a PV and use SvEND, otherwise fallback to an equivalent method to get the end of the string: e = s + slen (?) Regards, Slaven


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.