In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/aabef0bb417fd0cadf1a045ae302bf96bb7b07ac?hp=e56a605e8f98dd29e64fecbc92a6af8044c717e9>
- Log ----------------------------------------------------------------- commit aabef0bb417fd0cadf1a045ae302bf96bb7b07ac Author: Chris 'BinGOs' Williams <[email protected]> Date: Thu Dec 4 22:59:24 2014 +0000 Update Encode to CPAN version 2.67 [DELTA] $Revision: 2.67 $ $Date: 2014/12/04 20:13:00 $ ! t/taint.t Now skips nonexistent methods like Encode::Detect->encode() should that be installed. This resolves RT#100105. https://rt.cpan.org/Ticket/Display.html?id=100105 ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 2 +- cpan/Encode/Encode.pm | 4 ++-- cpan/Encode/t/taint.t | 26 +++++++++++++++++++------- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 03e73ee..48bb6fe 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -390,7 +390,7 @@ use File::Glob qw(:case); }, 'Encode' => { - 'DISTRIBUTION' => 'DANKOGAI/Encode-2.66.tar.gz', + 'DISTRIBUTION' => 'DANKOGAI/Encode-2.67.tar.gz', 'FILES' => q[cpan/Encode], 'CUSTOMIZED' => [ qw( encoding.pm ) ], }, diff --git a/cpan/Encode/Encode.pm b/cpan/Encode/Encode.pm index dd9a042..eec1485 100644 --- a/cpan/Encode/Encode.pm +++ b/cpan/Encode/Encode.pm @@ -1,10 +1,10 @@ # -# $Id: Encode.pm,v 2.66 2014/12/02 23:30:00 dankogai Exp $ +# $Id: Encode.pm,v 2.67 2014/12/04 20:12:29 dankogai Exp $ # package Encode; use strict; use warnings; -our $VERSION = sprintf "%d.%02d", q$Revision: 2.66 $ =~ /(\d+)/g; +our $VERSION = sprintf "%d.%02d", q$Revision: 2.67 $ =~ /(\d+)/g; use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG}; use XSLoader (); XSLoader::load( __PACKAGE__, $VERSION ); diff --git a/cpan/Encode/t/taint.t b/cpan/Encode/t/taint.t index ade8b07..1ad033b 100644 --- a/cpan/Encode/t/taint.t +++ b/cpan/Encode/t/taint.t @@ -3,13 +3,25 @@ use strict; use Encode qw(encode decode); use Scalar::Util qw(tainted); use Test::More; - -my $str = "abc" . substr($ENV{PATH},0,0); # tainted string +my $str = "dan\x{5f3e}" . substr($ENV{PATH},0,0); # tainted string to encode +my $bin = encode('UTF-8', $str); # tainted binary to decode my @names = Encode->encodings(':all'); plan tests => 2 * @names; -for my $name (@names){ - my $e = encode($name, $str); - ok tainted($e), "encode $name"; - my $d = decode($name, $e); - ok tainted($d), "decode $name"; +for my $name (@names) { + my ($d, $e, $s); + eval { + $e = encode($name, $str); + }; + SKIP: { + skip $@, 1 if $@; + ok tainted($e), "encode $name"; + } + $bin = $e if $e; + eval { + $d = decode($name, $bin); + }; + SKIP: { + skip $@, 1 if $@; + ok tainted($d), "decode $name"; + } } -- Perl5 Master Repository
