From: Rafael Garcia-Suarez Date: Mon, 31 Oct 2005 16:24:31 +0000 (+0000) Subject: Avoid corruption when calling mg_get to retrieve the value X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f6ba99206280472c9e353abb350d114de9d2591b;p=p5sagit%2Fp5-mst-13.2.git Avoid corruption when calling mg_get to retrieve the value of a $digit variable. This is done by ensuring it's not tainted. See http://bugs.debian.org/303308 Patch by Chris Heath p4raw-id: //depot/perl@25932 --- diff --git a/mg.c b/mg.c index ec4dcd3..31df285 100644 --- a/mg.c +++ b/mg.c @@ -841,7 +841,10 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg) getrx: if (i >= 0) { + int oldtainted = PL_tainted; + TAINT_NOT; sv_setpvn(sv, s, i); + PL_tainted = oldtainted; if (RX_MATCH_UTF8(rx) && is_utf8_string((U8*)s, i)) SvUTF8_on(sv); else