diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-13 01:49:54 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-03-13 01:49:54 +0000 |
commit | f806a02a48dffd4879055cd8cdc1895a0a6c926e (patch) | |
tree | 6c61227927ac37c4d373490dda12a0ed461491c8 /libexec/login_skey | |
parent | 2d29c72143d0f8408606ffb11045f029da0762f6 (diff) |
Correct CMSG_SPACE and CMSG_LEN usage everywhere in the tree. Due to
an extensive discussion with otto, kettenis, millert, and hshoexer
Diffstat (limited to 'libexec/login_skey')
-rw-r--r-- | libexec/login_skey/login_skey.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libexec/login_skey/login_skey.c b/libexec/login_skey/login_skey.c index 0adea84540f..9a036c72e88 100644 --- a/libexec/login_skey/login_skey.c +++ b/libexec/login_skey/login_skey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: login_skey.c,v 1.19 2007/07/26 17:48:41 millert Exp $ */ +/* $OpenBSD: login_skey.c,v 1.20 2008/03/13 01:49:52 deraadt Exp $ */ /* * Copyright (c) 2000, 2001, 2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -263,11 +263,14 @@ send_fd(int sock) { struct msghdr msg; struct cmsghdr *cmp; - char cmsgbuf[CMSG_SPACE(sizeof(int))]; + union { + struct cmsghdr hdr; + char buf[CMSG_SPACE(sizeof(int))]; + } cmsgbuf; memset(&msg, 0, sizeof(msg)); - msg.msg_control = cmsgbuf; - msg.msg_controllen = CMSG_LEN(sizeof(int)); + msg.msg_control = &cmsgbuf.buf; + msg.msg_controllen = sizeof(cmsgbuf.buf); cmp = CMSG_FIRSTHDR(&msg); cmp->cmsg_len = CMSG_LEN(sizeof(int)); |