From 2fc743ab6e1985a2d7ec00ab03a6fa1193866c66 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 21 Feb 1997 08:45:00 +0000 Subject: [PATCH] do not allow SO_SNDBUF/SO_RCVBUF len 0 --- sys/kern/uipc_socket2.c | 4 ++-- 1 file 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); -- 2.20.1