diff options
author | Robin Barker <Robin.Barker@npl.co.uk> | 2009-06-23 14:51:45 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-06-23 14:51:45 +0200 |
commit | 3c4fb04a912b266806354630dd98a7e36a830fbe (patch) | |
tree | e85b9a08503591b7cc3263f9b2e254af7c6a10d8 /t/op/taint.t | |
parent | ab9c44463cd5786e679d9c70d5575ccb9d47ede5 (diff) | |
download | perl-3c4fb04a912b266806354630dd98a7e36a830fbe.tar.gz |
Fix for RT #52552.
This patch only taints for pack('a'/'A') which was the original bug. I
guess the previous behaviour (pre-5.10.0) tainted on all tainted input.
That more general behaviour may be recoverable - not sure what we want.
Diffstat (limited to 't/op/taint.t')
-rw-r--r-- | t/op/taint.t | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 01ab368607..0ac02a6306 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ use Config; use File::Spec::Functions; BEGIN { require './test.pl'; } -plan tests => 298; +plan tests => 301; $| = 1; @@ -1303,6 +1303,19 @@ foreach my $ord (78, 163, 256) { } } +# Bug RT #52552 - broken by change at git commit id f337b08 +{ + my $x = $TAINT. q{print "Hello world\n"}; + my $y = pack "a*", $x; + ok(tainted($y), "pack a* preserves tainting"); + + my $z = pack "A*", q{print "Hello world\n"}.$TAINT; + ok(tainted($z), "pack A* preserves tainting"); + + my $zz = pack "a*a*", q{print "Hello world\n"}, $TAINT; + ok(tainted($zz), "pack a*a* preserves tainting"); +} + # This may bomb out with the alarm signal so keep it last SKIP: { skip "No alarm()" unless $Config{d_alarm}; |