From: Rick Delaney Date: Wed, 5 Nov 2003 23:02:41 +0000 (-0500) Subject: Re: [perl #24248] taint propagation regression, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b4182dec6e1b5c702d8a7ae385af2ab2a185d3c;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #24248] taint propagation regression, tests fail to spot this Message-Id: <20031105230241.D13585@biff.bort.ca> p4raw-id: //depot/perl@21674 --- diff --git a/pp_ctl.c b/pp_ctl.c index 37b0a20..8ce813c 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -59,6 +59,7 @@ PP(pp_regcreset) /* XXXX Should store the old value to allow for tie/overload - and restore in regcomp, where marked with XXXX. */ PL_reginterp_cnt = 0; + TAINT_NOT; return NORMAL; } diff --git a/t/op/taint.t b/t/op/taint.t index e7740fe..b27dcde 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -124,7 +124,7 @@ my $echo = "$Invoke_Perl $ECHO"; my $TEST = catfile(curdir(), 'TEST'); -print "1..208\n"; +print "1..220\n"; # First, let's make sure that Perl is checking the dangerous # environment variables. Maybe they aren't set yet, so we'll @@ -993,3 +993,35 @@ else eval { system("lskdfj"); }; test 208, $@ =~ /^%ENV is aliased to %nonmagicalenv while running with -T switch/; } +{ + # [perl #24248] + $TAINT =~ /(.*)/; + test 209, !tainted($1); + my $notaint = $1; + test 210, !tainted($notaint); + + my $l; + $notaint =~ /($notaint)/; + $l = $1; + test 211, !tainted($1); + test 212, !tainted($l); + $notaint =~ /($TAINT)/; + $l = $1; + test 213, tainted($1); + test 214, tainted($l); + + $TAINT =~ /($notaint)/; + $l = $1; + test 215, !tainted($1); + test 216, !tainted($l); + $TAINT =~ /($TAINT)/; + $l = $1; + test 217, tainted($1); + test 218, tainted($l); + + my $r; + ($r = $TAINT) =~ /($notaint)/; + test 219, !tainted($1); + ($r = $TAINT) =~ /($TAINT)/; + test 220, tainted($1); +}