From 291beb079a311a2f9852574770121813d7ab6779 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Wed, 3 Jul 2002 02:31:01 +0000 Subject: fix a null deref in sysctl_iflist() --- sys/net/rtsock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') 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; -- cgit v1.2.3