Wierdly, it seems that in perl 5.8.8, either of packing and unpacking with "B*" untaints, unpacking with "N*" untaints; but packing with "N*" or packing and unpacking with "C*" or "a*" doesn't untaint a scalar. I've no idea what the correct behaiviour should be.
Not really related, but note that this command doesn't raise an insecure dependency error:
it segfaults.perl -wTe '() = unpack $ARGV[0], 1e9;' p
However, the result of such an unpack is tainted, as can be seen from the error from this command.
perl -wTe '$z = pack "p", "hi\n"; $r = unpack $ARGV[0], $z; eval $r;' +p
Update: I forgot to say that I found this bug when re-examining Re: What's your favourite method of untainting?.
Update: see perlbug ticket #52552.
In reply to Re: pack() untaints data : bug or undocumented Perl 5.10 feature?
by ambrus
in thread pack() untaints data : bug or undocumented Perl 5.10 feature?
by mr_mischief
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |