diff options
author | djm@openbsd.org <djm@openbsd.org> | 2015-02-25 23:05:47 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2015-02-26 10:09:59 +1100 |
commit | 6e6458b476ec854db33e3e68ebf4f489d0ab3df8 (patch) | |
tree | 103c2c7418349e7915efbb3e3eda841dcd3167ea /monitor_fdpass.c | |
parent | a63cfa26864b93ab6afefad0b630e5358ed8edfa (diff) |
upstream commit
zero cmsgbuf before use; we initialise the bits we use
but valgrind still spams warning on it
Diffstat (limited to 'monitor_fdpass.c')
-rw-r--r-- | monitor_fdpass.c | 4 |
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 @@ | |||
1 | /* $OpenBSD: monitor_fdpass.c,v 1.19 2010/01/12 00:58:25 djm Exp $ */ | 1 | /* $OpenBSD: monitor_fdpass.c,v 1.20 2015/02/25 23:05:47 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 2001 Niels Provos <provos@citi.umich.edu> | 3 | * Copyright 2001 Niels Provos <provos@citi.umich.edu> |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -70,6 +70,7 @@ mm_send_fd(int sock, int fd) | |||
70 | msg.msg_accrights = (caddr_t)&fd; | 70 | msg.msg_accrights = (caddr_t)&fd; |
71 | msg.msg_accrightslen = sizeof(fd); | 71 | msg.msg_accrightslen = sizeof(fd); |
72 | #else | 72 | #else |
73 | memset(&cmsgbuf, 0, sizeof(cmsgbuf)); | ||
73 | msg.msg_control = (caddr_t)&cmsgbuf.buf; | 74 | msg.msg_control = (caddr_t)&cmsgbuf.buf; |
74 | msg.msg_controllen = sizeof(cmsgbuf.buf); | 75 | msg.msg_controllen = sizeof(cmsgbuf.buf); |
75 | cmsg = CMSG_FIRSTHDR(&msg); | 76 | cmsg = CMSG_FIRSTHDR(&msg); |
@@ -136,6 +137,7 @@ mm_receive_fd(int sock) | |||
136 | msg.msg_accrights = (caddr_t)&fd; | 137 | msg.msg_accrights = (caddr_t)&fd; |
137 | msg.msg_accrightslen = sizeof(fd); | 138 | msg.msg_accrightslen = sizeof(fd); |
138 | #else | 139 | #else |
140 | memset(&cmsgbuf, 0, sizeof(cmsgbuf)); | ||
139 | msg.msg_control = &cmsgbuf.buf; | 141 | msg.msg_control = &cmsgbuf.buf; |
140 | msg.msg_controllen = sizeof(cmsgbuf.buf); | 142 | msg.msg_controllen = sizeof(cmsgbuf.buf); |
141 | #endif | 143 | #endif |