From 8bbffd547a5d7ce11413aff2082f97aafe9d7a51 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 14 Oct 2015 14:55:14 -0400 Subject: [PATCH] Port: move memset of anc_buf inside ifdef MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- src/common/sessiond-comm/unix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/sessiond-comm/unix.c b/src/common/sessiond-comm/unix.c index 77a6013f0..e2d0def8e 100644 --- a/src/common/sessiond-comm/unix.c +++ b/src/common/sessiond-comm/unix.c @@ -396,10 +396,11 @@ ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len) size_t sizeof_cred = sizeof(lttng_sock_cred); char anc_buf[CMSG_SPACE(sizeof_cred)]; lttng_sock_cred *creds; + + memset(anc_buf, 0, CMSG_SPACE(sizeof_cred) * sizeof(char)); #endif /* __linux__ */ memset(&msg, 0, sizeof(msg)); - memset(anc_buf, 0, CMSG_SPACE(sizeof_cred) * sizeof(char)); iov[0].iov_base = buf; iov[0].iov_len = len; -- 2.34.1