summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2009-07-21 14:10:14 +0000
committermillert <millert@openbsd.org>2009-07-21 14:10:14 +0000
commit99e53febf88c48dfd377d46b6761bf71fe3076ce (patch)
treed7f55f288ca8a7e14362c832522bda507af6973a /sys/kern/kern_sysctl.c
parentAdd a family flag for the original 5700 series chipsets. Idea from FreeBSD. (diff)
downloadwireguard-openbsd-99e53febf88c48dfd377d46b6761bf71fe3076ce.tar.xz
wireguard-openbsd-99e53febf88c48dfd377d46b6761bf71fe3076ce.zip
Handle the case where so_pcb is NULL.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 86a14a2f8b1..82b2bd64b2f 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_sysctl.c,v 1.176 2009/07/19 12:56:19 millert Exp $ */
+/* $OpenBSD: kern_sysctl.c,v 1.177 2009/07/21 14:10:14 millert Exp $ */
/* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */
/*-
@@ -1086,6 +1086,8 @@ fill_file2(struct kinfo_file2 *kf, struct file *fp, struct filedesc *fdp,
kf->so_pcb = PTRTOINT64(so->so_pcb);
kf->so_protocol = so->so_proto->pr_protocol;
kf->so_family = so->so_proto->pr_domain->dom_family;
+ if (!so->so_pcb)
+ break;
switch (kf->so_family) {
case AF_INET: {
struct inpcb *inpcb = so->so_pcb;