summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/send.2
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-07-28 19:47:07 +0000
committermillert <millert@openbsd.org>1998-07-28 19:47:07 +0000
commit1f681a38ff09a42a10d6fd9d1fe951b7460bf87a (patch)
tree0611465b28b9f5a3bab6185f83d5254a85556a41 /lib/libc/sys/send.2
parentFix indentation problems. (diff)
downloadwireguard-openbsd-1f681a38ff09a42a10d6fd9d1fe951b7460bf87a.tar.xz
wireguard-openbsd-1f681a38ff09a42a10d6fd9d1fe951b7460bf87a.zip
For read, write, send, sendto, recv, recvfrom return EINVAL is size arg > SSIZE_MAX. For readv, writev, sendmsg, recvmsg return EINVAL if sum of the over iov_len values overflows an ssize_t. Based on what XPG 4.2 says (though XPG is not entirely consistent here). Basically since the return value is ssize_t allowing size > SSIZE_MAX is bad since people who (incorrectly mind you) check the return value for < 0 instead of == -1 will have bad things happen to them.
Diffstat (limited to 'lib/libc/sys/send.2')
-rw-r--r--lib/libc/sys/send.219
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/libc/sys/send.2 b/lib/libc/sys/send.2
index be9234bae76..2e522a1be9f 100644
--- a/lib/libc/sys/send.2
+++ b/lib/libc/sys/send.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: send.2,v 1.6 1998/07/28 04:49:32 millert Exp $
+.\" $OpenBSD: send.2,v 1.7 1998/07/28 19:47:12 millert Exp $
.\" $NetBSD: send.2,v 1.6 1996/01/15 01:17:18 thorpej Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -34,7 +34,7 @@
.\"
.\" @(#)send.2 8.2 (Berkeley) 2/21/94
.\"
-.Dd July 27, 1998
+.Dd July 28, 1998
.Dt SEND 2
.Os BSD 4.2
.Sh NAME
@@ -161,6 +161,18 @@ parameter is invalid.
.El
.Pp
In addition,
+.Fn send
+and
+.Fn sendto
+may return following error:
+.Bl -tag -width Er
+.It Bq Er EINVAL
+.Fa len
+was larger than
+.Ev SSIZE_MAX .
+.El
+.Pp
+Also,
.Fn sendmsg
may return following error:
.Bl -tag -width Er
@@ -169,7 +181,8 @@ The sum of the
.Fa iov_len
values in the
.Fa msg_iov
-array overflowed an unsigned 32-bit integer.
+array overflowed an
+.Em ssize_t .
.El
.Sh SEE ALSO
.Xr fcntl 2 ,