summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-03 02:31:01 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-07-03 02:31:01 +0000
commit291beb079a311a2f9852574770121813d7ab6779 (patch)
treeded51c87ed8589b0ee51bacfdd8c8d71f0d5ec51 /sys/net
parenteedaff02206d7be09280a17f9f421a7f5a2bdf48 (diff)
fix a null deref in sysctl_iflist()
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/rtsock.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/rtsock.c b/sys/net/rtsock.c
index 5ed615dfc9e..3f42b8ddc8b 100644
--- a/sys/net/rtsock.c
+++ b/sys/net/rtsock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsock.c,v 1.22 2002/07/02 19:38:55 nate Exp $ */
+/* $OpenBSD: rtsock.c,v 1.23 2002/07/03 02:31:00 mickey Exp $ */
/* $NetBSD: rtsock.c,v 1.18 1996/03/29 00:32:10 cgd Exp $ */
/*
@@ -815,6 +815,8 @@ sysctl_iflist(af, w)
if (w->w_arg && w->w_arg != ifp->if_index)
continue;
ifa = TAILQ_FIRST(&ifp->if_addrlist);
+ if (!ifa)
+ continue;
ifpaddr = ifa->ifa_addr;
len = rt_msg2(RTM_IFINFO, &info, (caddr_t)0, w);
ifpaddr = 0;