summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2018-08-15 17:07:51 -0600
committerKarl Williamson <khw@cpan.org>2019-02-14 22:12:44 -0700
commitc413aa1fa6bdc64c4a1ca5967a4f45c0ea003da8 (patch)
tree7688714c9f52d2b77e4ca0d4e907569019955d26 /t/op
parentde5659380e7c1c711fbe4cef1ee09c7460bd5f55 (diff)
downloadperl-c413aa1fa6bdc64c4a1ca5967a4f45c0ea003da8.tar.gz
t/op/taint.t: Add test
Diffstat (limited to 't/op')
-rw-r--r--t/op/taint.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index adb6907a45..ca67024d1c 100644
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -17,7 +17,7 @@ BEGIN {
use strict;
use Config;
-plan tests => 1041;
+plan tests => 1042;
$| = 1;
@@ -2380,6 +2380,22 @@ end
eval { "A" =~ /\p{$prop}/};
like($@, qr/Insecure user-defined property "IsA" in regex/,
"user-defined property: tainted case");
+
+}
+
+{
+
+ local $ENV{XX} = '\p{IsB}'; # Making it an environment variable taints it
+
+ fresh_perl_like(<<'EOF',
+ BEGIN { $re = qr/$ENV{XX}/; }
+
+ sub IsB { "42" };
+ "B" =~ $re
+EOF
+ qr/Insecure user-defined property \\p\{main::IsB\}/,
+ { switches => [ "-T" ] },
+ "user-defined property; defn not known until runtime, tainted case");
}
{