Commit f8f15f67 authored by Dan Carpenter's avatar Dan Carpenter Committed by Johannes Berg
Browse files

wifi: cw1200: cap SSID length in cw1200_do_join()



If the ssidie[1] length is more that 32 it leads to memory corruption.

Fixes: a910e4a9 ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/e91fb43fcedc4893b604dfb973131661510901a7.1756456951.git.dan.carpenter@linaro.org


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 629840e2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1291,7 +1291,7 @@ static void cw1200_do_join(struct cw1200_common *priv)
		rcu_read_lock();
		ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
		if (ssidie) {
			join.ssid_len = ssidie[1];
			join.ssid_len = min(ssidie[1], IEEE80211_MAX_SSID_LEN);
			memcpy(join.ssid, &ssidie[2], join.ssid_len);
		}
		rcu_read_unlock();