From: Nicholas Clark Date: Mon, 13 Feb 2006 21:46:13 +0000 (+0000) Subject: Ensure that public I, N and P flags are off when SvTAINT is called on X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a509ed3c095f7d712013e653f68821f6bb2d6db;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/sv.c b/sv.c index 883ba58..8c18a83 100644 --- a/sv.c +++ b/sv.c @@ -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; } }