Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Feb 2010 10:12:49 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203423 - head/sys/net80211
Message-ID:  <201002031012.o13ACndR059983@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Wed Feb  3 10:12:49 2010
New Revision: 203423
URL: http://svn.freebsd.org/changeset/base/203423

Log:
  Avoid a null pointer deref when parsing the meshid.
  
  Found with:	clang static analyzer

Modified:
  head/sys/net80211/ieee80211_mesh.c

Modified: head/sys/net80211/ieee80211_mesh.c
==============================================================================
--- head/sys/net80211/ieee80211_mesh.c	Wed Feb  3 10:07:43 2010	(r203422)
+++ head/sys/net80211/ieee80211_mesh.c	Wed Feb  3 10:12:49 2010	(r203423)
@@ -1468,11 +1468,12 @@ mesh_recv_mgmt(struct ieee80211_node *ni
 		if (xrates != NULL)
 			IEEE80211_VERIFY_ELEMENT(xrates,
 			    IEEE80211_RATE_MAXSIZE - rates[1], return);
-		if (meshid != NULL)
+		if (meshid != NULL) {
 			IEEE80211_VERIFY_ELEMENT(meshid,
 			    IEEE80211_MESHID_LEN, return);
-		/* NB: meshid, not ssid */
-		IEEE80211_VERIFY_SSID(vap->iv_bss, meshid, return);
+			/* NB: meshid, not ssid */
+			IEEE80211_VERIFY_SSID(vap->iv_bss, meshid, return);
+		}
 
 		/* XXX find a better class or define it's own */
 		IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_INPUT, wh->i_addr2,



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