diff options
author | Tony Cook <tony@develop-help.com> | 2012-03-11 14:38:57 +1100 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2012-08-09 16:04:11 -0400 |
commit | 3f22bd654dbafc1220c5360d5e685b11d99a5404 (patch) | |
tree | 8b24d1c48989b7d201ba566a5a644476c9143939 | |
parent | ee4a2a70c059f719bca4701c84452297d9cc153f (diff) | |
download | perl-3f22bd654dbafc1220c5360d5e685b11d99a5404.tar.gz |
properly propagate tainted errors
Backport af89892ed and 05a1a0145d by Tony Cook to 5.14
Bug: https://rt.perl.org/rt3/Public/Bug/Display.html?id=111654
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=663158
-rw-r--r-- | pp_sys.c | 2 | ||||
-rw-r--r-- | t/op/taint.t | 10 |
2 files changed, 9 insertions, 3 deletions
@@ -497,7 +497,7 @@ PP(pp_die) } } } - else if (SvPOK(ERRSV) && SvCUR(ERRSV)) { + else if (SvPV_const(ERRSV, len), len) { exsv = sv_mortalcopy(ERRSV); sv_catpvs(exsv, "\t...propagated"); } diff --git a/t/op/taint.t b/t/op/taint.t index a300b9b264..3a2b5d9396 100644 --- a/t/op/taint.t +++ b/t/op/taint.t @@ -17,7 +17,7 @@ BEGIN { use strict; use Config; -plan tests => 778; +plan tests => 779; $| = 1; @@ -2156,7 +2156,13 @@ end ok(!tainted "", "tainting still works after index() of the constant"); } - +{ # 111654 + eval { + eval { die "Test\n".substr($ENV{PATH}, 0, 0); }; + die; + }; + like($@, qr/^Test\n\t\.\.\.propagated at /, "error should be propagated"); +} # This may bomb out with the alarm signal so keep it last SKIP: { |