summaryrefslogtreecommitdiffstats
path: root/monitor_fdpass.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2015-02-26 00:05:47 +0100
committerDamien Miller <djm@mindrot.org>2015-02-26 00:09:59 +0100
commit6e6458b476ec854db33e3e68ebf4f489d0ab3df8 (patch)
tree103c2c7418349e7915efbb3e3eda841dcd3167ea /monitor_fdpass.c
parentupstream commit (diff)
downloadopenssh-6e6458b476ec854db33e3e68ebf4f489d0ab3df8.tar.xz
openssh-6e6458b476ec854db33e3e68ebf4f489d0ab3df8.zip
upstream commit
zero cmsgbuf before use; we initialise the bits we use but valgrind still spams warning on it
Diffstat (limited to '')
-rw-r--r--monitor_fdpass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 100fa5660..2ddd80732 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor_fdpass.c,v 1.19 2010/01/12 00:58:25 djm Exp $ */
+/* $OpenBSD: monitor_fdpass.c,v 1.20 2015/02/25 23:05:47 djm Exp $ */
/*
* Copyright 2001 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -70,6 +70,7 @@ mm_send_fd(int sock, int fd)
msg.msg_accrights = (caddr_t)&fd;
msg.msg_accrightslen = sizeof(fd);
#else
+ memset(&cmsgbuf, 0, sizeof(cmsgbuf));
msg.msg_control = (caddr_t)&cmsgbuf.buf;
msg.msg_controllen = sizeof(cmsgbuf.buf);
cmsg = CMSG_FIRSTHDR(&msg);
@@ -136,6 +137,7 @@ mm_receive_fd(int sock)
msg.msg_accrights = (caddr_t)&fd;
msg.msg_accrightslen = sizeof(fd);
#else
+ memset(&cmsgbuf, 0, sizeof(cmsgbuf));
msg.msg_control = &cmsgbuf.buf;
msg.msg_controllen = sizeof(cmsgbuf.buf);
#endif