Avoid a null pointer deref when parsing the meshid.

Found with:	clang static analyzer
This commit is contained in:
Rui Paulo 2010-02-03 10:12:49 +00:00
parent 2b80a3409e
commit 6c9462571f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203423

View File

@ -1468,11 +1468,12 @@ mesh_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, int subtype,
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,