summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/uipc_usrreq.c8
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);