summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-02-20 09:58:01 +1200
committerChip Salzenberg <chip@atlantic.net>1997-02-22 04:41:00 +1200
commit9212bbba480c82a883da56c53e3d103dc36aa284 (patch)
tree181e463eb7a19b96ed43ba01ada2322994020f52 /pp_ctl.c
parent8bc0c6bd1de3e2ed6fe3c9fb3d47057f034b23aa (diff)
downloadperl-9212bbba480c82a883da56c53e3d103dc36aa284.tar.gz
Don't taint $x in C<$x = ($tainted =~ /(\w+)/)>
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index a667986c79..c70375b730 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -123,6 +123,8 @@ PP(pp_substcont)
SV *targ = cx->sb_targ;
sv_catpvn(dstr, s, cx->sb_strend - s);
+ TAINT_IF(cx->sb_rxtainted || rx->exec_tainted);
+
(void)SvOOK_off(targ);
Safefree(SvPVX(targ));
SvPVX(targ) = SvPVX(dstr);
@@ -133,8 +135,7 @@ PP(pp_substcont)
(void)SvPOK_only(targ);
SvSETMAGIC(targ);
- if (cx->sb_rxtainted)
- SvTAINTED_on(targ);
+ SvTAINT(targ);
PUSHs(sv_2mortal(newSViv((I32)cx->sb_iters - 1)));
LEAVE_SCOPE(cx->sb_oldsave);
POPSUBST(cx);