summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2012-03-11 14:38:57 +1100
committerTony Cook <tony@develop-help.com>2012-03-12 10:09:45 +1100
commit05a1a0145d15cec87e1ea2fd2386895cc1658eb3 (patch)
treef46e94b18c5678477e86aa3cc932a7c81ed65333
parentaf89892edf2ed1bf0c26d1b75e74d81410d8c81f (diff)
downloadperl-05a1a0145d15cec87e1ea2fd2386895cc1658eb3.tar.gz
[rt #111654] properly propgate tainted errors
A magic value (such as a tainted string) may not have POK set, so call SvPV() to find out if there's something in ERRSV to report. Possibly this should be using SvPV_nomg(), but this is the first request for magic in this code. Maybe the code above should be calling SvGETMAGIC() before checking SvROK().
-rw-r--r--pp_sys.c2
-rw-r--r--t/op/taint.t1
2 files changed, 1 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 63fbd05863..49910d2985 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -500,7 +500,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 095c99115a..9cea74040c 100644
--- a/t/op/taint.t
+++ b/t/op/taint.t
@@ -2198,7 +2198,6 @@ pass("no death when TARG of ref is tainted");
}
{ # 111654
- local $::TODO = "RT #111654";
eval {
eval { die "Test\n".substr($ENV{PATH}, 0, 0); };
die;