diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-21 08:45:01 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-02-21 08:45:01 +0000 |
commit | dd0628276401bc289c980ddfd7eaa2626edb23ad (patch) | |
tree | 38f22fd6d5bc3aa122a0603276d1345bb2655948 /sys/kern | |
parent | 7a30cc3d08ae261fca9ad829b5608555193842c2 (diff) |
do not allow SO_SNDBUF/SO_RCVBUF len 0
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_socket2.c | 4 |
1 files changed, 2 insertions, 2 deletions
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); |