This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
ee1ec05
)
lib/locale.t: Untaint before checking if next thing taints
author
Karl Williamson
<public@khwilliamson.com>
Tue, 18 Feb 2014 18:45:48 +0000
(11:45 -0700)
committer
Karl Williamson
<public@khwilliamson.com>
Wed, 19 Feb 2014 21:31:38 +0000
(14:31 -0700)
The tests weren't testing what they purported to, as we should be sure
to start with untained values to see if the operation taints.
lib/locale.t
patch
|
blob
|
blame
|
history
diff --git
a/lib/locale.t
b/lib/locale.t
index
b195394
..
1dce940
100644
(file)
--- a/
lib/locale.t
+++ b/
lib/locale.t
@@
-159,6
+159,14
@@
check_taint $+;
check_taint $1;
check_taint_not $2;
+/(.)/; # untaint $&, $`, $', $+, $1.
+check_taint_not $&, '/(.)/';
+check_taint_not $`;
+check_taint_not $';
+check_taint_not $+;
+check_taint_not $1;
+check_taint_not $2;
+
/(\s)/; # taint $&, $`, $', $+, $1.
check_taint $&;
check_taint $`;
@@
-167,6
+175,9
@@
check_taint $+;
check_taint $1;
check_taint_not $2;
+/(.)/; # untaint $&, $`, $', $+, $1.
+check_taint_not $&, '/(.)/';
+
/(\S)/; # taint $&, $`, $', $+, $1.
check_taint $&;
check_taint $`;