diff options
author | 2012-04-13 19:16:11 +0000 | |
---|---|---|
committer | 2012-04-13 19:16:11 +0000 | |
commit | a00f2a54a9ac78426c8465e8b66d0936a32d5cac (patch) | |
tree | 2ef4ef42e891db4fcf15588c9d98f365a53f8bea | |
parent | Do not clamp the file descriptors to the buffer size; that leads to (diff) | |
download | wireguard-openbsd-a00f2a54a9ac78426c8465e8b66d0936a32d5cac.tar.xz wireguard-openbsd-a00f2a54a9ac78426c8465e8b66d0936a32d5cac.zip |
oops, wrong version of diff in previous
Diffstat (limited to '')
-rw-r--r-- | sys/kern/uipc_usrreq.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index a832142876b..c8c37890a2e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_usrreq.c,v 1.58 2012/04/13 19:12:44 deraadt Exp $ */ +/* $OpenBSD: uipc_usrreq.c,v 1.59 2012/04/13 19:16:11 deraadt Exp $ */ /* $NetBSD: uipc_usrreq.c,v 1.18 1996/02/09 19:00:50 christos Exp $ */ /* @@ -649,8 +649,10 @@ unp_externalize(struct mbuf *rights, socklen_t controllen) controllen = 0; else controllen -= CMSG_ALIGN(sizeof(struct cmsghdr)); - if (nfds > controllen / sizeof(int)) - return EMSGSIZE; + if (nfds > controllen / sizeof(int)) { + error = EMSGSIZE; + goto restart; + } rp = (struct file **)CMSG_DATA(cm); |