diff options
author | 2004-09-15 17:50:33 +0000 | |
---|---|---|
committer | 2004-09-15 17:50:33 +0000 | |
commit | 88d6af9a6436c5f7ce3441163816a9b3eb8e710c (patch) | |
tree | 0d84c11bf90ee6f4eae6a536d3b7667a27e9b02a | |
parent | Typo in #endif comment. (diff) | |
download | wireguard-openbsd-88d6af9a6436c5f7ce3441163816a9b3eb8e710c.tar.xz wireguard-openbsd-88d6af9a6436c5f7ce3441163816a9b3eb8e710c.zip |
Check for num < 0 in sysctl_sensors(); from Patrick Latifi.
ok millert@
-rw-r--r-- | sys/kern/kern_sysctl.c | 4 |
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) |