Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Jul 2015 16:28:36 +0000 (UTC)
From:      Ermal Luçi <eri@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285325 - head/sys/netinet
Message-ID:  <201507091628.t69GSaFX041687@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eri
Date: Thu Jul  9 16:28:36 2015
New Revision: 285325
URL: https://svnweb.freebsd.org/changeset/base/285325

Log:
  Correct issue presented in r285051,
  apparently neither clang nor gcc complain about this.
  But clang intis the var to NULL correctly while gcc on at least mips does not.
  Correct the undefined behavior by initializing the variable properly.
  
  PR:		201371
  Differential Revision:	 https://reviews.freebsd.org/D3036
  Reviewed by:	gnn
  Approved by:	gnn(mentor)

Modified:
  head/sys/netinet/ip_input.c

Modified: head/sys/netinet/ip_input.c
==============================================================================
--- head/sys/netinet/ip_input.c	Thu Jul  9 16:13:05 2015	(r285324)
+++ head/sys/netinet/ip_input.c	Thu Jul  9 16:28:36 2015	(r285325)
@@ -941,7 +941,8 @@ ip_forward(struct mbuf *m, int srcrt)
 	if (ro.ro_rt != NULL) {
 		ia = ifatoia(ro.ro_rt->rt_ifa);
 		ifa_ref(&ia->ia_ifa);
-	}
+	} else
+		ia = NULL;
 #ifndef IPSEC
 	/*
 	 * 'ia' may be NULL if there is no route for this destination.



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