commit:     dc071dfacd23686dd3ae7168c60193618e36f0fa
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Mar 15 01:05:45 2018 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Mar 15 02:26:07 2018 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=dc071dfa

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, " ");

Reply via email to