summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorAlexander Yurchenko <grange@cvs.openbsd.org>2004-09-15 17:50:34 +0000
committerAlexander Yurchenko <grange@cvs.openbsd.org>2004-09-15 17:50:34 +0000
commita78ee3d8db7e5912f0637ede21172d9e3deeec04 (patch)
tree3db0cf356b87787dfbc2e9545b76d62f4628efa4 /sys/kern
parentdbf4f165d29e11b373b542c9d31a76059f79ce1c (diff)
Check for num < 0 in sysctl_sensors(); from Patrick Latifi.
ok millert@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_sysctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 9599fe397ad..e5a508e0fc6 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.118 2004/07/28 17:15:12 tholo Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.119 2004/09/15 17:50:33 grange Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1837,7 +1837,7 @@ sysctl_sensors(int *name, u_int namelen, void *oldp, size_t *oldlenp,
return (ENOTDIR);
num = name[0];
- if (num >= nsensors)
+ if (num < 0 || num >= nsensors)
return (ENXIO);
SLIST_FOREACH(s, &sensors, list)