summaryrefslogtreecommitdiff
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2009-07-21 14:10:16 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2009-07-21 14:10:16 +0000
commitfd588f904297301cd1887403b2a83fa6e2abf4f5 (patch)
tree3868adbfd78f953dc5cd73b45a8af5c7cbc9cf89 /sys/kern/kern_sysctl.c
parent7ca85a069ee41a122f19fb2d2d13178e1a9ff0cb (diff)
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;