From 10cde58f3351ae7a0259283bb9d59cf3fa7da6aa Mon Sep 17 00:00:00 2001 From: np Date: Sun, 3 Jan 2010 06:43:13 +0000 Subject: Avoid NULL dereference in arpresolve. --- sys/netinet/if_ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/netinet') diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 4e26ebc..a259278 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -372,8 +372,8 @@ retry: if (la->la_asked < V_arp_maxtries) error = EWOULDBLOCK; /* First request. */ else - error = - (rt0->rt_flags & RTF_GATEWAY) ? EHOSTUNREACH : EHOSTDOWN; + error = rt0 != NULL && (rt0->rt_flags & RTF_GATEWAY) ? + EHOSTUNREACH : EHOSTDOWN; if (renew) { LLE_ADDREF(la); -- cgit v1.1