diff options
author | Hugo van der Sanden <hv@crypt.org> | 2002-08-04 23:40:22 +0000 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-08-04 23:40:22 +0000 |
commit | e9814ee1ed9f0b1debd0da67ac6d70cbfec03e3d (patch) | |
tree | c39684ebe3501d7908a4e52d97cd4e20fc124785 /mg.c | |
parent | a8c7c11a510ba1b065a5e57da04d34c2f89e233b (diff) | |
download | perl-e9814ee1ed9f0b1debd0da67ac6d70cbfec03e3d.tar.gz |
[ID 20020704.001] again: #17678 caused test failures in pod2html,
in which $1 could leak from previous regexp
p4raw-id: //depot/perl@17679
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -698,19 +698,20 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) SvUTF8_on(sv); else SvUTF8_off(sv); - if (PL_tainting) - PL_tainted = PL_tainted || !!RX_MATCH_TAINTED(rx); - if (RX_MATCH_TAINTED(rx)) { - MAGIC* mg = SvMAGIC(sv); - MAGIC* mgt; - SvMAGIC(sv) = mg->mg_moremagic; - SvTAINT(sv); - if ((mgt = SvMAGIC(sv))) { - mg->mg_moremagic = mgt; - SvMAGIC(sv) = mg; - } - } else - SvTAINTED_off(sv); + if (PL_tainting) { + if (RX_MATCH_TAINTED(rx)) { + MAGIC* mg = SvMAGIC(sv); + MAGIC* mgt; + PL_tainted = 1; + SvMAGIC(sv) = mg->mg_moremagic; + SvTAINT(sv); + if ((mgt = SvMAGIC(sv))) { + mg->mg_moremagic = mgt; + SvMAGIC(sv) = mg; + } + } else + SvTAINTED_off(sv); + } break; } } |