summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-03-14 16:04:59 +0000
committerDavid Mitchell <davem@iabyn.com>2011-03-14 16:31:25 +0000
commite06d98fb28fb93799939b64c5cd2d41f83060c81 (patch)
tree933c857945a62c61ecdfb5461eb9c1b10c8fe79a /pp_sys.c
parent295c2f7d5349d9417307a84d22b5ba63d9a655ed (diff)
downloadperl-e06d98fb28fb93799939b64c5cd2d41f83060c81.tar.gz
[perl #82250] fix tainted (s)print format
commit 20ee07fbbcfa6be9f90bb8e5474a4d69d7396617 introduced dieing in (s)printf when the format is tainted; however it only worked when the format is part of an expression (because TAINT_PROPER checks for PL_tainted being set). Fix by doing TAINT_PROPER only after get magic has been done on the format SV (which will set PL_tainted). This is done by moving the checks in pp_sprintf and pp_prtf into do_sprintf() (which is called by the two pp functions).
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 30a2645459..3c421332c0 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -1531,8 +1531,6 @@ PP(pp_prtf)
goto just_say_no;
}
else {
- if (SvTAINTED(MARK[1]))
- TAINT_PROPER("printf");
do_sprintf(sv, SP - MARK, MARK + 1);
if (!do_print(sv, fp))
goto just_say_no;