From 716bc1cdf3619fc744ddf62973acf3a83cd982b1 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Mon, 14 Sep 1998 23:35:02 +0000 Subject: allow the recvfrom (fd, NULL, 0, MSG_PEEK, ...) again, pr 584. --- sys/kern/uipc_syscalls.c | 8 +++++--- 1 file 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 -- cgit v1.2.3