supervise-daemon: zero out the cmdline buffer when it is allocated

This commit is contained in:
William Hubbs 2018-02-22 12:54:21 -06:00
parent 5868abe97b
commit 98262647a9

View File

@ -233,6 +233,7 @@ static char *make_cmdline(char **argv)
for (c = argv; c && *c; c++) for (c = argv; c && *c; c++)
len += (strlen(*c) + 1); len += (strlen(*c) + 1);
cmdline = xmalloc(len); cmdline = xmalloc(len);
memset(cmdline, 0, len);
for (c = argv; c && *c; c++) { for (c = argv; c && *c; c++) {
strcat(cmdline, *c); strcat(cmdline, *c);
strcat(cmdline, " "); strcat(cmdline, " ");