Change 30167 by [EMAIL PROTECTED] on 2007/02/07 23:49:44

        TODO tests for eval of tainted scalars. (change 29193's regression)

Affected files ...

... //depot/perl/t/op/taint.t#80 edit

Differences ...

==== //depot/perl/t/op/taint.t#80 (xtext) ====
Index: perl/t/op/taint.t
--- perl/t/op/taint.t#79~29713~ 2007-01-07 23:19:02.000000000 -0800
+++ perl/t/op/taint.t   2007-02-07 15:49:44.000000000 -0800
@@ -17,7 +17,7 @@
 use File::Spec::Functions;
 
 BEGIN { require './test.pl'; }
-plan tests => 257;
+plan tests => 260;
 
 $| = 1;
 
@@ -1214,3 +1214,19 @@
     $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/);
+}
End of Patch.

Reply via email to