diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-02-07 23:49:44 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-02-07 23:49:44 +0000 |
commit | 5e500fc8e5f18cb370411f45f81b60a9e64dd0e5 (patch) | |
tree | fcaa43e7ae12c3b31757a51b8e5f19a28c95d2d6 /t | |
parent | a8fb48f7d682d4a043c30ec3ec06da197a6845f4 (diff) | |
download | perl-5e500fc8e5f18cb370411f45f81b60a9e64dd0e5.tar.gz |
TODO tests for eval of tainted scalars. (change 29193's regression)
p4raw-id: //depot/perl@30167
Diffstat (limited to 't')
-rwxr-xr-x | t/op/taint.t | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index ec7c498171..f66110870a 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 => 257; +plan tests => 260; $| = 1; @@ -1214,3 +1214,19 @@ SKIP: $val = $n; is ($val, '7000000000', 'Assignment to tainted variable'); } + +{ + local $::TODO = "eval currently ignores tainting"; + my $val = 0; + my $tainted = '1' . $TAINT; + eval '$val = eval $tainted;'; + is ($val, 0, "eval doesn't like tainted strings"); + like ($@, qr/^Insecure dependency in eval/); + + # Rather nice code to get a tainted by from Rick Delaney + open 0 or die $!; + $tainted=(<0>,<0>); + + eval 'eval $tainted'; + like ($@, qr/^Insecure dependency in eval/); +} |