From 0b573fe9fc90d181651e5d6e87cdaabd27eb2843 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Mon, 23 Oct 2006 07:13:57 +0000 Subject: fix control message length check, needs CMSG_ALIGN() reported by ryo@nerv.org to netbsd, noticed by miod, ok millert --- sys/kern/uipc_syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern') 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 -- cgit v1.2.3