summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>1998-09-14 23:35:02 +0000
committerNiels Provos <provos@cvs.openbsd.org>1998-09-14 23:35:02 +0000
commit716bc1cdf3619fc744ddf62973acf3a83cd982b1 (patch)
tree3ab9f557da8d51d782cd1716e4827a96be08439e
parentf6d8c48668b04c5ce21f5fc07fd5a0cdd6af874a (diff)
allow the recvfrom (fd, NULL, 0, MSG_PEEK, ...) again, pr 584.
-rw-r--r--sys/kern/uipc_syscalls.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 52e5b3458ce..6b717d315e7 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_syscalls.c,v 1.12 1998/08/05 16:35:44 millert Exp $ */
+/* $OpenBSD: uipc_syscalls.c,v 1.13 1998/09/14 23:35:01 provos Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */
/*
@@ -437,7 +437,8 @@ sendit(p, s, mp, flags, retsize)
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
/* Don't allow sum > SSIZE_MAX */
- if ((ssize_t)(auio.uio_resid += iov->iov_len) <= 0)
+ if ((ssize_t)(auio.uio_resid += iov->iov_len) <= 0 &&
+ (iov->iov_base != 0 || iov->iov_len != 0))
return (EINVAL);
}
if (mp->msg_name) {
@@ -627,7 +628,8 @@ recvit(p, s, mp, namelenp, retsize)
iov = mp->msg_iov;
for (i = 0; i < mp->msg_iovlen; i++, iov++) {
/* Don't allow sum > SSIZE_MAX */
- if ((ssize_t)(auio.uio_resid += iov->iov_len) <= 0)
+ if ((ssize_t)(auio.uio_resid += iov->iov_len) <= 0 &&
+ (iov->iov_base != 0 || iov->iov_len != 0))
return (EINVAL);
}
#ifdef KTRACE