Skip Menu |

This queue is for tickets about the Test-Taint CPAN distribution.

Report information
The Basics
Id: 5667
Status: resolved
Priority: 0/
Queue: Test-Taint

People
Owner: Nobody in particular
Requestors: autarch [...] urth.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.01
Fixed in: (no value)



Subject: taint() converts string to value 0!
Calling taint() and passing it a string converts that string to a numeric 0. The offending code appears to be this: if ( not $_ & '00' | '00' ) { # Must already be a number, # so don't stringify it now $_ += $TAINT0; } else { $_ .= $TAINT; } At least under 5.6.1 and 5.8.3, the conditional appears to always be true, this num-ifying the passed in string. I really don't know how to fix this without using XS (something like SvPOK). Of course, wouldn't it be simpler to just rewrite the taint() function in XS and call SvTAINTED_on() ? That's what I think, so I've included a patch that does that. It also includes a test for this bug.
Download tt
application/octet-stream 18.6k

Message body not shown because it is not plain text.

Show quoted text
> Of course, wouldn't it be simpler to just rewrite the taint() function > in XS and call SvTAINTED_on() ?
If you are schooled in the ways of XS, yes. For me, I just went down that road a few weeks ago for HTML::Tidy, so it's all new to me. Thanks for the patch. I'm releasing it tonight.