Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Jan 2010 06:43:13 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r201416 - head/sys/netinet
Message-ID:  <201001030643.o036hDQ6092252@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Sun Jan  3 06:43:13 2010
New Revision: 201416
URL: http://svn.freebsd.org/changeset/base/201416

Log:
  Avoid NULL dereference in arpresolve.

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==============================================================================
--- head/sys/netinet/if_ether.c	Sun Jan  3 04:38:38 2010	(r201415)
+++ head/sys/netinet/if_ether.c	Sun Jan  3 06:43:13 2010	(r201416)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001030643.o036hDQ6092252>