diff options
author | Rick Delaney <rick@consumercontact.com> | 2006-07-09 11:01:50 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2006-08-02 09:49:10 +0000 |
commit | 5d121f7f3e622b953c8ef74cf9c345d07e4f4ed7 (patch) | |
tree | 2197d0a5443e3acd0d02005ae947003ee701b32b /t | |
parent | b1e55cab83fc5b3a567d95fba8bca0592334b7a5 (diff) | |
download | perl-5d121f7f3e622b953c8ef74cf9c345d07e4f4ed7.tar.gz |
Re: [perl #39733] $AUTOLOAD is never tainted
Message-ID: <20060709190150.GA1922@localhost.localdomain>
Plus a note in perldelta
p4raw-id: //depot/perl@28649
Diffstat (limited to 't')
-rwxr-xr-x | t/op/taint.t | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 03bcc65768..8311690194 100755 --- 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 => 249; +plan tests => 251; $| = 1; @@ -1185,3 +1185,22 @@ SKIP: test $@ =~ /Insecure \$ENV/, 'popen neglects %ENV check'; } } + +{ + package AUTOLOAD_TAINT; + sub AUTOLOAD { + our $AUTOLOAD; + return if $AUTOLOAD =~ /DESTROY/; + if ($AUTOLOAD =~ /untainted/) { + main::ok(!main::tainted($AUTOLOAD), '$AUTOLOAD can be untainted'); + } else { + main::ok(main::tainted($AUTOLOAD), '$AUTOLOAD can be tainted'); + } + } + + package main; + my $o = bless [], 'AUTOLOAD_TAINT'; + $o->$TAINT; + $o->untainted; +} + |