in reply to Tainting problem on Strawberry perl
I don't see anything wrong in the dumps, and you didn't point out anything specific (Update: OP has since been updated to include expected+actual values), but these two tips should help.
Don't pass globals to functions that may modify them. (I consider anything in perlvar unsafe.)
$wdir = File::Spec->catfile($cdir, $1); # Bad $wdir = File::Spec->catfile($cdir, "$1"); # Good, $1 is copied.
Avoid using $1, $2, anywhere except immediately after where they are set, and only to copy them. This may not be necessary, but it is definitely safe, worry-free and better than using variables with meaningless names.
By the way, your untainting is rather arbitrary (it ignores anything starting with the first \x0A) and defies the whole idea of tainting (it allows everything else including \x00).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tainting problem on Strawberry perl
by EvanCarroll (Chaplain) on Feb 28, 2008 at 22:43 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:04 UTC | |
by EvanCarroll (Chaplain) on Feb 28, 2008 at 23:09 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:33 UTC | |
by syphilis (Archbishop) on Feb 28, 2008 at 23:42 UTC | |
by ikegami (Patriarch) on Feb 28, 2008 at 23:52 UTC |