summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2012-02-25 20:32:09 +0000
committerZefram <zefram@fysh.org>2012-02-25 20:38:12 +0000
commit19db9fb7213e8d346c88f2b573e378f35d81ffcf (patch)
tree60e83adf4deb9104d21bb3c3ec71b04b9fc65c8e /t
parente0f138939ac28fffc7b06bea23950f5dd6a72f37 (diff)
downloadperl-19db9fb7213e8d346c88f2b573e378f35d81ffcf.tar.gz
don't taint $$ determined by getpid()
Reading $$ in a tainted expression was tainting the internal sv_setiv() on $$. Since the value being set came directly from getpid(), it's always safe, so override the tainting there. Fixes [perl #109688].
Diffstat (limited to 't')
-rw-r--r--t/op/taint.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t
index 0b626f340c..1b754399f9 100644
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -17,7 +17,7 @@ BEGIN {
use strict;
use Config;
-plan tests => 791;
+plan tests => 793;
$| = 1;
@@ -2176,6 +2176,13 @@ for(1,2) {
}
pass("no death when TARG of ref is tainted");
+# $$ should not be tainted by being read in a tainted expression.
+{
+ isnt_tainted $$, "PID not tainted initially";
+ my $x = $ENV{PATH}.$$;
+ isnt_tainted $$, "PID not tainted when read in tainted expression";
+}
+
{
use feature 'fc';
use locale;