From 5346fbf2c90b33b3abc01588e4727d4402f8db62 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Wed, 14 Mar 2018 20:05:45 -0500 Subject: supervise-daemon: fix off-by-one error --- src/rc/supervise-daemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index 669db3a2..952c610b 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -232,8 +232,8 @@ static char *make_cmdline(char **argv) for (c = argv; c && *c; c++) len += (strlen(*c) + 1); - cmdline = xmalloc(len); - memset(cmdline, 0, len); + cmdline = xmalloc(len+1); + memset(cmdline, 0, len+1); for (c = argv; c && *c; c++) { strcat(cmdline, *c); strcat(cmdline, " "); -- cgit v1.2.3