From: deraadt Date: Fri, 21 Feb 1997 08:45:00 +0000 (+0000) Subject: do not allow SO_SNDBUF/SO_RCVBUF len 0 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2fc743ab6e1985a2d7ec00ab03a6fa1193866c66;p=openbsd do not allow SO_SNDBUF/SO_RCVBUF len 0 --- diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 92ab13de5e1..1641822b28a 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.4 1996/09/20 22:53:10 deraadt Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.5 1997/02/21 08:45:00 deraadt Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -397,7 +397,7 @@ sbreserve(sb, cc) u_long cc; { - if (cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES)) + if (cc == 0 || cc > sb_max * MCLBYTES / (MSIZE + MCLBYTES)) return (0); sb->sb_hiwat = cc; sb->sb_mbmax = min(cc * 2, sb_max);