Without this, if $...::AUTOLOAD ever becomes tainted, it will never
subsequently become properly untainted. This fixes an omission in change
5d121f7f3e622b95.
varsv = GvSVn(vargv);
sv_setpvn(varsv, packname, packname_len);
sv_catpvs(varsv, "::");
- sv_catpvn(varsv, name, len);
+ /* Ensure SvSETMAGIC() is called if necessary. In particular, to clear
+ tainting if $FOO::AUTOLOAD was previously tainted, but is not now. */
+ sv_catpvn_mg(varsv, name, len);
return gv;
}
use File::Spec::Functions;
BEGIN { require './test.pl'; }
-plan tests => 689;
+plan tests => 693;
$| = 1;
return if $AUTOLOAD =~ /DESTROY/;
if ($AUTOLOAD =~ /untainted/) {
main::ok(!main::tainted($AUTOLOAD), '$AUTOLOAD can be untainted');
+ my $copy = $AUTOLOAD;
+ main::ok(!main::tainted($copy), '$AUTOLOAD can be untainted');
} else {
main::ok(main::tainted($AUTOLOAD), '$AUTOLOAD can be tainted');
+ my $copy = $AUTOLOAD;
+ main::ok(main::tainted($copy), '$AUTOLOAD can be tainted');
}
}
package main;
my $o = bless [], 'AUTOLOAD_TAINT';
+ $o->untainted;
$o->$TAINT;
$o->untainted;
}