New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing for taint and utf8 on magic values #7725
Comments
From perl-5.8.0@ton.iguana.beCreated by perl-5.8.0@ton.iguana.be#! /usr/bin/perl -wlT sub TIEHASH { tie my %stuff, "main"; Gives: But actually both tests should have errored out since there is no Effectively they are missing get magics. I think is_utf8 in universal.c should really be something like: XS(XS_utf8_is_utf8) (notice that a method like utf8::valid uses SvPV, which DOES get magic, For tainted I suppose the fix is in ext/List/Util/Util.xs, int And the fallback perl version (in lib/Scalar/Util.pm) could be: sub tainted { (most code *untested*) Perl Info
|
From @ysthOn Sat, Dec 25, 2004 at 11:52:21PM -0000, "perl-5. 8. 0 @ ton. iguana. be" wrote:
That's insufficient for overloading (which isn't handled like regular
* should also result in a mg_get...does it not?
|
The RT System itself - Status changed from 'new' to 'open' |
From perl5-porters@ton.iguana.beIn article <20041226230112.GA3552@e_n.org>,
mm, didn't know that, that makes some of my XS code incomplete then.
Mm, here you probably don't want to trigger "" overload, so SvGETMAGIC
Ah right, it does. I had actually tested it, but missed the fact that So how about: sub tainted { mm, the NaN-discussion makes me realize that not everything times 0 This seems to work for all cases I can think of: sub tainted { |
From @ysthOn Mon, Dec 27, 2004 at 01:27:27AM +0000, Ton Hospel <perl5-porters@ton.iguana.be> wrote:
The rule is, you can only check the UTF8 flag *after* calling SvPV |
From @HugmeirOn Sun Dec 26 17:35:35 2004, ysth wrote:
Running this on 5.14.2 and blead, I get: So utf8::is_utf8() was fixed, but tainted() was not. I tried with both { my $i = 0; sub Tie::TIESCALAR { bless \$arg => $class; sub Tie::FETCH { package main; my $bar = "The Big Bright Green Pleasure Machine"; my $baz = $foo; ok $i == 1; Because now FETCH gets called twice, so $i ends up as 2. Unfortunately I |
Migrated from rt.perl.org#33186 (status was 'open')
Searchable as RT33186$
The text was updated successfully, but these errors were encountered: