diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2005-12-19 22:07:49 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2005-12-19 22:07:49 +0000 |
commit | e26a497577f3ce7b9a4d9e1e62062839554dfd8f (patch) | |
tree | 565d0f56618f07b8a59ed1b0bdeeef91100cc59f /t | |
parent | 756cb4773036ba2209d91fd1e0325202c13604e4 (diff) | |
download | perl-e26a497577f3ce7b9a4d9e1e62062839554dfd8f.tar.gz |
[perl #8262] //g loops infinitely on tainted data
make the LHS of expr =~ /foo/g an lvalue, so that any pos magic
attached to it stays attached.
p4raw-id: //depot/perl@26410
Diffstat (limited to 't')
-rwxr-xr-x | t/op/taint.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 7f9d06e037..4aab7374f9 100755 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ use Config; use File::Spec::Functions; BEGIN { require './test.pl'; } -plan tests => 244; +plan tests => 245; $| = 1; @@ -1135,3 +1135,17 @@ TERNARY_CONDITIONALS: { eval { local $0, eval '1' }; test $@ eq ''; } + +# [perl #8262] //g loops infinitely on tainted data + +{ + my @a; + $a[0] = $^X; + my $i = 0; + while($a[0]=~ m/(.)/g ) { + last if $i++ > 10000; + } + test $i < 10000, "infinite m//g"; + +} + |