diff options
author | Damien Miller <djm@mindrot.org> | 2008-03-27 00:54:44 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-03-27 00:54:44 +0100 |
commit | be71e2d9725cf0833ee208222eb6860bb17316ef (patch) | |
tree | 594de0c2c1e853be62ee6403c8b22b7a5a69236e /monitor_fdpass.c | |
parent | - deraadt@cvs.openbsd.org 2008/03/13 01:49:53 (diff) | |
download | openssh-be71e2d9725cf0833ee208222eb6860bb17316ef.tar.xz openssh-be71e2d9725cf0833ee208222eb6860bb17316ef.zip |
- deraadt@cvs.openbsd.org 2008/03/15 16:19:02
[monitor_fdpass.c]
Repair the simple cases for msg_controllen where it should just be
CMSG_SIZE(sizeof(int)), not sizeof(buffer) which may be larger because
of alignment; ok kettenis hshoexer
Diffstat (limited to '')
-rw-r--r-- | monitor_fdpass.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/monitor_fdpass.c b/monitor_fdpass.c index a3e995df8..18ae6248a 100644 --- a/monitor_fdpass.c +++ b/monitor_fdpass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_fdpass.c,v 1.15 2008/03/13 01:49:53 deraadt Exp $ */ +/* $OpenBSD: monitor_fdpass.c,v 1.16 2008/03/15 16:19:02 deraadt Exp $ */ /* * Copyright 2001 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -63,7 +63,7 @@ mm_send_fd(int sock, int fd) msg.msg_accrightslen = sizeof(fd); #else msg.msg_control = (caddr_t)&cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); cmsg = CMSG_FIRSTHDR(&msg); cmsg->cmsg_len = CMSG_LEN(sizeof(int)); cmsg->cmsg_level = SOL_SOCKET; @@ -121,7 +121,7 @@ mm_receive_fd(int sock) msg.msg_accrightslen = sizeof(fd); #else msg.msg_control = &cmsgbuf.buf; - msg.msg_controllen = sizeof(cmsgbuf.buf); + msg.msg_controllen = CMSG_LEN(sizeof(int)); #endif if ((n = recvmsg(sock, &msg, 0)) == -1) { |