diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2006-10-23 07:13:57 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2006-10-23 07:13:57 +0000 |
commit | 0b573fe9fc90d181651e5d6e87cdaabd27eb2843 (patch) | |
tree | 9db0a5bf662297201920c6cc9e1a755e653ce5a6 | |
parent | 42f8cea1de3f682047053e73ddb1be54d8a61e0c (diff) |
fix control message length check, needs CMSG_ALIGN()
reported by ryo@nerv.org to netbsd, noticed by miod, ok millert
-rw-r--r-- | sys/kern/uipc_syscalls.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index bd8c22a50cb..3627d7c4ce3 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.65 2006/10/21 02:18:00 tedu Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.66 2006/10/23 07:13:56 henning Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -482,7 +482,7 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) goto bad; } if (mp->msg_control) { - if (mp->msg_controllen < sizeof(struct cmsghdr) + if (mp->msg_controllen < CMSG_ALIGN(sizeof(struct cmsghdr)) #ifdef COMPAT_OLDSOCK && mp->msg_flags != MSG_COMPAT #endif |