diff options
author | Greg Steuck <gnezdo@cvs.openbsd.org> | 2023-06-23 04:36:50 +0000 |
---|---|---|
committer | Greg Steuck <gnezdo@cvs.openbsd.org> | 2023-06-23 04:36:50 +0000 |
commit | 28c218ed871a65b7c20488a7df07018590a5cbbe (patch) | |
tree | 0663ba3447b165bc9534a2f20211c5579038712f /sys | |
parent | c919c08f5d532d306f6147b09eaa0052faac4d08 (diff) |
Avoid division by 0 in m_pool_used
OK dlg@
Reported-by: syzbot+a377d5cd833c2343429a@syzkaller.appspotmail.com
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 440a1ec5ecb..ba59f13a954 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.286 2023/05/16 20:09:27 mvs Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.287 2023/06/23 04:36:49 gnezdo Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -214,7 +214,7 @@ nmbclust_update(long newval) { int i; - if (newval < 0 || newval > LONG_MAX / MCLBYTES) + if (newval <= 0 || newval > LONG_MAX / MCLBYTES) return ERANGE; /* update the global mbuf memory limit */ nmbclust = newval; |