diff options
author | Radu Greab <radu@netsoft.ro> | 2000-10-03 01:03:44 +0300 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-02 23:35:40 +0000 |
commit | 35fba0d9b63c24c469494ae4d5dc6f37fed89345 (patch) | |
tree | 4a3a2033c50e7c9a1eeb6732682fe21898afa3d6 /t/op/substr.t | |
parent | 01bb7c6d67bc951562ed98068eba189cadd42374 (diff) | |
download | perl-35fba0d9b63c24c469494ae4d5dc6f37fed89345.tar.gz |
Re: [ID 20000912.008] substr replacement of tainted data (bug)
Message-ID: <14808.56336.594486.626712@busy.netsoft.ro>
p4raw-id: //depot/perl@7111
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-x | t/op/substr.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t index 891e9041a7..4d3bbce927 100755 --- a/t/op/substr.t +++ b/t/op/substr.t @@ -1,6 +1,6 @@ #!./perl -print "1..135\n"; +print "1..136\n"; #P = start of string Q = start of substr R = end of substr S = end of string @@ -297,3 +297,10 @@ ok 125, $a eq 'xxxxefgh'; ok 134, length($z) == 5; ok 135, $z eq "21\x{263a}10"; } + +# replacement should work on magical values +require Tie::Scalar; +my %data; +tie $data{'a'}, 'Tie::StdScalar'; # makes $data{'a'} magical +$data{a} = "firstlast"; +ok 136, substr($data{'a'}, 0, 5, "") eq "first" && $data{'a'} eq "last"; |