From 22be8b3ce79e213f2d415174c221bf661da5963b Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Wed, 3 Oct 2001 09:30:55 -0500 Subject: [PATCH] %ENV tainting for VMS Message-Id: <5.1.0.14.0.20011003124800.01bd31c0@exchi01> p4raw-id: //depot/perl@12321 --- vms/vms.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/vms/vms.c b/vms/vms.c index 057cb84c1d..c076809778 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); } } } -- 2.34.1