summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2006-03-11 01:52:37 +0000
committerCraig A. Berry <craigberry@mac.com>2006-03-11 01:52:37 +0000
commitb011c7bd39d14e47dbc58c5c24b1aec8c961a3d9 (patch)
treec06e9a29085bcbabc52218a1f49bb18bfc2919de
parent5336380d3e98d40ceb0f5b533b012f0e4cd65847 (diff)
downloadperl-b011c7bd39d14e47dbc58c5c24b1aec8c961a3d9.tar.gz
null terminate command string -- broken in #27438
p4raw-id: //depot/perl@27467
-rw-r--r--vms/vms.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 82169ad50e..22c58094b6 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -8546,9 +8546,9 @@ setup_cmddsc(pTHX_ const char *incmd, int check_img, int *suggest_quote,
/* It's either a DCL command or we couldn't find a suitable image */
vmscmd->dsc$w_length = strlen(cmd);
- vmscmd->dsc$a_pointer = PerlMem_malloc(vmscmd->dsc$w_length);
+ vmscmd->dsc$a_pointer = PerlMem_malloc(vmscmd->dsc$w_length + 1);
strncpy(vmscmd->dsc$a_pointer,cmd,vmscmd->dsc$w_length);
- vmscmd->dsc$a_pointer[vmscmd->dsc$w_length];
+ vmscmd->dsc$a_pointer[vmscmd->dsc$w_length] = 0;
PerlMem_free(cmd);