Front page | perl.perl5.changes |
Postings from December 2008
Change 34988: Integrate:
From:
Nicholas Clark
Date:
December 3, 2008 02:00
Subject:
Change 34988: Integrate:
Change 34988 by nicholas@nicholas-plum on 2008/12/03 09:56:04
Integrate:
[ 34987]
Fix for tainting regression in a test of Text::Template spotted by
Andreas' smoker.
Affected files ...
... //depot/maint-5.10/perl/scope.c#8 integrate
... //depot/maint-5.10/perl/t/op/taint.t#3 integrate
Differences ...
==== //depot/maint-5.10/perl/scope.c#8 (text) ====
Index: perl/scope.c
--- perl/scope.c#7~34962~ 2008-12-01 01:09:13.000000000 -0800
+++ perl/scope.c 2008-12-03 01:56:04.000000000 -0800
@@ -615,6 +615,8 @@
void* ptr;
register char* str;
I32 i;
+ /* Localise the effects of the TAINT_NOT inside the loop. */
+ const bool was = PL_tainted;
if (base < -1)
Perl_croak(aTHX_ "panic: corrupt saved stack index");
@@ -1051,6 +1053,8 @@
Perl_croak(aTHX_ "panic: leave_scope inconsistency");
}
}
+
+ PL_tainted = was;
}
void
==== //depot/maint-5.10/perl/t/op/taint.t#3 (xtext) ====
Index: perl/t/op/taint.t
--- perl/t/op/taint.t#2~34273~ 2008-09-05 06:59:17.000000000 -0700
+++ perl/t/op/taint.t 2008-12-03 01:56:04.000000000 -0800
@@ -17,7 +17,7 @@
use File::Spec::Functions;
BEGIN { require './test.pl'; }
-plan tests => 267;
+plan tests => 294;
$| = 1;
@@ -1252,6 +1252,42 @@
ok(!tainted($1), "\\S match with chr $ord");
}
+{
+ my @data = qw(bonk zam zlonk qunckkk);
+ # Clearly some sort of usenet bang-path
+ my $string = $TAINT . join "!", @data;
+
+ ok(tainted($string), "tainted data");
+
+ my @got = split /!|,/, $string;
+
+ # each @got would be useful here, but I want the test for earlier perls
+ for my $i (0 .. $#data) {
+ ok(tainted($got[$i]), "tainted result $i");
+ is($got[$i], $data[$i], "correct content $i");
+ }
+
+ ok(tainted($string), "still tainted data");
+
+ my @got = split /[!,]/, $string;
+
+ # each @got would be useful here, but I want the test for earlier perls
+ for my $i (0 .. $#data) {
+ ok(tainted($got[$i]), "tainted result $i");
+ is($got[$i], $data[$i], "correct content $i");
+ }
+
+ ok(tainted($string), "still tainted data");
+
+ my @got = split /!/, $string;
+
+ # each @got would be useful here, but I want the test for earlier perls
+ for my $i (0 .. $#data) {
+ ok(tainted($got[$i]), "tainted result $i");
+ is($got[$i], $data[$i], "correct content $i");
+ }
+}
+
# This may bomb out with the alarm signal so keep it last
SKIP: {
skip "No alarm()" unless $Config{d_alarm};
End of Patch.
-
Change 34988: Integrate:
by Nicholas Clark