From f4a9e54dda85b8514ac47509768ed124c05b3d76 Mon Sep 17 00:00:00 2001 From: Marc Singer Date: Thu, 5 Apr 2012 19:43:34 -0700 Subject: [PATCH] Fixing Valgrind discovered issues. o Clearing buffer sent via sendmsg. --- shellinabox/launcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shellinabox/launcher.c b/shellinabox/launcher.c index 8c89578..5c5fac9 100644 --- a/shellinabox/launcher.c +++ b/shellinabox/launcher.c @@ -1662,7 +1662,7 @@ static void launcherDaemon(int fd) { // Send file handle and process id back to parent char cmsg_buf[CMSG_SPACE(sizeof(int))]; // = { 0 }; // Valid initializer makes OSX mad. - cmsg_buf[0] = 0; + memset (cmsg_buf, 0, sizeof (cmsg_buf)); // Quiet complaint from valgrind struct iovec iov = { 0 }; struct msghdr msg = { 0 }; iov.iov_base = &pid;