diff options
author | Craig A. Berry <craigberry@mac.com> | 2006-03-11 01:52:37 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2006-03-11 01:52:37 +0000 |
commit | b011c7bd39d14e47dbc58c5c24b1aec8c961a3d9 (patch) | |
tree | c06e9a29085bcbabc52218a1f49bb18bfc2919de | |
parent | 5336380d3e98d40ceb0f5b533b012f0e4cd65847 (diff) | |
download | perl-b011c7bd39d14e47dbc58c5c24b1aec8c961a3d9.tar.gz |
null terminate command string -- broken in #27438
p4raw-id: //depot/perl@27467
-rw-r--r-- | vms/vms.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |