diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-13 21:46:13 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-13 21:46:13 +0000 |
commit | 2a509ed3c095f7d712013e653f68821f6bb2d6db (patch) | |
tree | 7eacb48b6953b1ce07510234897cabed51e99eb3 | |
parent | 0be96356bfca2623ae6f5872908239eb3b0f61c9 (diff) | |
download | perl-2a509ed3c095f7d712013e653f68821f6bb2d6db.tar.gz |
Ensure that public I, N and P flags are off when SvTAINT is called on
something that already has taint magic.
p4raw-id: //depot/perl@27176
-rw-r--r-- | sv.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -4242,8 +4242,13 @@ Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 nam /* sv_magic() refuses to add a magic of the same 'how' as an existing one */ - if (how == PERL_MAGIC_taint) + if (how == PERL_MAGIC_taint) { mg->mg_len |= 1; + /* Any scalar which already had taint magic on which someone + (erroneously?) did SvIOK_on() or similar will now be + incorrectly sporting public "OK" flags. */ + SvFLAGS(sv) &= ~(SVf_IOK|SVf_NOK|SVf_POK); + } return; } } |