diff options
author | David Mitchell <davem@iabyn.com> | 2011-03-14 16:04:59 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2011-03-14 16:31:25 +0000 |
commit | e06d98fb28fb93799939b64c5cd2d41f83060c81 (patch) | |
tree | 933c857945a62c61ecdfb5461eb9c1b10c8fe79a /pp.c | |
parent | 295c2f7d5349d9417307a84d22b5ba63d9a655ed (diff) | |
download | perl-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.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -3708,8 +3708,6 @@ PP(pp_index) PP(pp_sprintf) { dVAR; dSP; dMARK; dORIGMARK; dTARGET; - if (SvTAINTED(MARK[1])) - TAINT_PROPER("sprintf"); SvTAINTED_off(TARG); do_sprintf(TARG, SP-MARK, MARK+1); TAINT_IF(SvTAINTED(TARG)); |