From: Craig A. Berry Date: Wed, 3 Oct 2001 14:30:55 +0000 (-0500) Subject: %ENV tainting for VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=22be8b3ce79e213f2d415174c221bf661da5963b;p=p5sagit%2Fp5-mst-13.2.git %ENV tainting for VMS Message-Id: <5.1.0.14.0.20011003124800.01bd31c0@exchi01> p4raw-id: //depot/perl@12321 --- diff --git a/vms/vms.c b/vms/vms.c index 057cb84..c076809 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -424,6 +424,7 @@ prime_env_iter(void) { static int primed = 0; HV *seenhv = NULL, *envhv; + SV *sv = NULL; char cmd[LNM$C_NAMLENGTH+24], mbxnam[LNM$C_NAMLENGTH], *buf = Nullch; unsigned short int chan; #ifndef CLI$M_TRUSTED @@ -497,8 +498,9 @@ prime_env_iter(void) } else { start++; - (void) hv_store(envhv,environ[j],start - environ[j] - 1, - newSVpv(start,0),0); + sv = newSVpv(start,0); + SvTAINTED_on(sv); + (void) hv_store(envhv,environ[j],start - environ[j] - 1,sv,0); } } continue; @@ -587,7 +589,9 @@ prime_env_iter(void) continue; } PERL_HASH(hash,key,keylen); - hv_store(envhv,key,keylen,newSVpvn(cp2,cp1 - cp2 + 1),hash); + sv = newSVpvn(cp2,cp1 - cp2 + 1); + SvTAINTED_on(sv); + hv_store(envhv,key,keylen,sv,hash); hv_store(seenhv,key,keylen,&PL_sv_yes,hash); } if (cmddsc.dsc$w_length == 14) { /* We just read LNM$FILE_DEV */ @@ -597,7 +601,9 @@ prime_env_iter(void) int trnlen, i; for (i = 0; ppfs[i]; i++) { trnlen = vmstrnenv(ppfs[i],eqv,0,fildev,0); - hv_store(envhv,ppfs[i],strlen(ppfs[i]),newSVpv(eqv,trnlen),0); + sv = newSVpv(eqv,trnlen); + SvTAINTED_on(sv); + hv_store(envhv,ppfs[i],strlen(ppfs[i]),sv,0); } } }