Message-id: <
200208041640.g74GeUU25061@crypt.compulink.co.uk>
p4raw-id: //depot/perl@17678
- bool was_tainted = FALSE;
- if (PL_tainting) {
- was_tainted = PL_tainted;
- PL_tainted = FALSE;
- }
- if (PL_reg_match_utf8 && is_utf8_string((U8*)s, i))
+ if (PL_reg_match_utf8 && is_utf8_string((U8*)s, i))
SvUTF8_on(sv);
else
SvUTF8_off(sv);
if (PL_tainting)
SvUTF8_on(sv);
else
SvUTF8_off(sv);
if (PL_tainting)
- PL_tainted = (was_tainted || RX_MATCH_TAINTED(rx));
+ 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);
my $TEST = catfile(curdir(), 'TEST');
my $TEST = catfile(curdir(), 'TEST');
# First, let's make sure that Perl is checking the dangerous
# environment variables. Maybe they aren't set yet, so we'll
# First, let's make sure that Perl is checking the dangerous
# environment variables. Maybe they aren't set yet, so we'll
# If you add tests here update also the above skip block for VMS.
}
# If you add tests here update also the above skip block for VMS.
}
+
+{
+ # [ID 20020704.001] taint propagation failure
+ use re 'taint';
+ $TAINT =~ /(.*)/;
+ test 206, tainted(my $foo = $1);
+}