Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

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

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

Bug Information
Severity: Normal
Broken in:
  • 2.18
  • 2.42
Fixed in: (no value)



Subject: Deep recursion error finding invalid charset
Download (untitled) / with headers
text/plain 123b
Encode::find_encoding() of a charset with lots of spaces causes a perl stack overflow. Test case attached to this ticket.
Subject: badcharset.t
Download badcharset.t
text/x-perl 671b
#!/bin/perl use Test::More no_plan; use strict; use warnings; use Encode; sub backtrace(;$) { my $level = shift() || 1; my $rv = ''; my ($last_package, undef, $last_line) = caller(++$level); my ($package, $line, $subroutine); while (($package, undef, $line, $subroutine) = caller(++$level)) { $subroutine = $last_package . $subroutine if ($subroutine =~ /^\(/); $rv .= " " if ($rv); $rv .= "${subroutine}[$last_line]"; $last_package = $package; $last_line = $line; } return $rv; } { local $SIG{__WARN__} = sub { fail("warning: $_[0]"); diag(backtrace()."\n")}; my $decoder = Encode::find_encoding('x'.(" x" x 1000)); }
Download (untitled) / with headers
text/plain 358b
Thank you for your report. Since there is no space in encoding names or aliases, this bug is now resolved by simply getting rid of \s from the input. Dan the Maintainer Thereof On Wed Feb 16 17:34:21 2011, JGMYERS wrote: Show quoted text
> Encode::find_encoding() of a charset with lots of spaces causes a perl > stack overflow. > > Test case attached to this ticket.


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.