diff options
author | Craig A. Berry <craigberry@mac.com> | 2003-02-15 06:29:03 -0600 |
---|---|---|
committer | hv <hv@crypt.org> | 2003-02-16 11:00:47 +0000 |
commit | ec618cdf8cd188a382b8a5ab7751b8c7e9ef80c2 (patch) | |
tree | 00fae90757a25e18e8682282e96e2f92a532deba | |
parent | 52a96ae66a5b0cd12cd52516c48cc6bf774e2038 (diff) | |
download | perl-ec618cdf8cd188a382b8a5ab7751b8c7e9ef80c2.tar.gz |
arcane tainting bug in vms.c
From: "Craig A. Berry" <craigberry@mac.com>
Message-ID: <3E4E86EF.8090609@mac.com>
p4raw-id: //depot/perl@18721
-rw-r--r-- | vms/vms.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -4449,15 +4449,19 @@ vms_image_init(int *argcp, char ***argvp) * hasn't been allocated when vms_image_init() is called. */ if (will_taint) { - char ***newap; - New(1320,newap,*argcp+2,char **); - newap[0] = argvp[0]; - *newap[1] = "-T"; - Copy(argvp[1],newap[2],*argcp-1,char **); + char **newargv, **oldargv; + oldargv = *argvp; + New(1320,newargv,(*argcp)+2,char *); + newargv[0] = oldargv[0]; + New(1320,newargv[1],3,char); + strcpy(newargv[1], "-T"); + Copy(&oldargv[1],&newargv[2],(*argcp)-1,char **); + (*argcp)++; + newargv[*argcp] = NULL; /* We orphan the old argv, since we don't know where it's come from, * so we don't know how to free it. */ - *argcp++; argvp = newap; + *argvp = newargv; } else { /* Did user explicitly request tainting? */ int i; |