From e85b7206f29c017d2100ff874c3802a292e1cbf1 Mon Sep 17 00:00:00 2001 From: bluhm Date: Tue, 4 May 2021 19:04:56 +0000 Subject: [PATCH] As the unbouded feature in sysctl_int_bounded() is no longer used, remove it. This also fixes a defective check of the dynamic boundary in sysctl_sysvshm(). OK mvs@ gnezdo@ --- sys/kern/kern_sysctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index c4cb0db1e43..0ac4a787594 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.392 2021/05/01 16:18:28 gnezdo Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.393 2021/05/04 19:04:56 bluhm Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -869,8 +869,8 @@ sysctl_int_bounded(void *oldp, size_t *oldlenp, void *newp, size_t newlen, if ((error = sysctl_int(oldp, oldlenp, newp, newlen, &val))) return (error); - /* bounded and outside limits */ - if (minimum < maximum && (val < minimum || maximum < val)) + /* outside limits */ + if (val < minimum || maximum < val) return (EINVAL); *valp = val; return (0); -- 2.20.1