diff options
author | 2014-08-12 01:25:21 +0000 | |
---|---|---|
committer | 2014-08-12 01:25:21 +0000 | |
commit | c9c20fc2efec90ca9baee1e1a14935540c94c6c4 (patch) | |
tree | f07381696d9a949aaa97020ff6d85faa86631ffe /sys/kern/subr_pool.c | |
parent | bring back r1.135: (diff) | |
download | wireguard-openbsd-c9c20fc2efec90ca9baee1e1a14935540c94c6c4.tar.xz wireguard-openbsd-c9c20fc2efec90ca9baee1e1a14935540c94c6c4.zip |
i accidentally removed the check for whether the requested pool in
the sysctl path exists. return ENOENT instead of trying a NULL
deref.
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r-- | sys/kern/subr_pool.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index 850d0f0b94e..e3fb051fbda 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_pool.c,v 1.143 2014/08/12 01:05:46 dlg Exp $ */ +/* $OpenBSD: subr_pool.c,v 1.144 2014/08/12 01:25:21 dlg Exp $ */ /* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */ /*- @@ -1427,7 +1427,7 @@ sysctl_dopool(int *name, u_int namelen, char *oldp, size_t *oldlenp) { struct kinfo_pool pi; struct pool *pp; - int rv; + int rv = ENOENT; int s; switch (name[0]) { @@ -1453,6 +1453,9 @@ sysctl_dopool(int *name, u_int namelen, char *oldp, size_t *oldlenp) break; } + if (pp == NULL) + goto done; + switch (name[0]) { case KERN_POOL_NAME: rv = sysctl_rdstring(oldp, oldlenp, NULL, pp->pr_wchan); @@ -1484,6 +1487,7 @@ sysctl_dopool(int *name, u_int namelen, char *oldp, size_t *oldlenp) splx(s); +done: return (rv); } |