the sysctl path exists. return ENOENT instead of trying a NULL
deref.
-/* $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 $ */
/*-
{
struct kinfo_pool pi;
struct pool *pp;
- int rv;
+ int rv = ENOENT;
int s;
switch (name[0]) {
break;
}
+ if (pp == NULL)
+ goto done;
+
switch (name[0]) {
case KERN_POOL_NAME:
rv = sysctl_rdstring(oldp, oldlenp, NULL, pp->pr_wchan);
splx(s);
+done:
return (rv);
}