diff options
Diffstat (limited to 't/op/taint.t')
-rw-r--r-- | t/op/taint.t | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/t/op/taint.t b/t/op/taint.t index 78b3d5591f..fc2fcd74bb 100644 --- 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 => 338; +plan tests => 339; $| = 1; @@ -1445,6 +1445,32 @@ end ok(! tainted($b), "regex optimization of single char /[]/i doesn't taint"); } +{ + # RT 81230: tainted value during FETCH created extra ref to tied obj + + package P81230; + use warnings; + + my %h; + + sub TIEHASH { + my $x = $^X; # tainted + bless \$x; + } + sub FETCH { my $x = $_[0]; $$x . "" } + + tie %h, 'P81230'; + + my $w = ""; + local $SIG{__WARN__} = sub { $w .= "@_" }; + + untie %h if $h{"k"}; + + ::is($w, "", "RT 81230"); +} + + + # This may bomb out with the alarm signal so keep it last SKIP: { skip "No alarm()" unless $Config{d_alarm}; |