Skip to content

Commit f8f15f6

Browse files
Dan Carpenterjmberg-intel
authored andcommitted
wifi: cw1200: cap SSID length in cw1200_do_join()
If the ssidie[1] length is more that 32 it leads to memory corruption. Fixes: a910e4a ("cw1200: add driver for the ST-E CW1100 & CW1200 WLAN chipsets") Signed-off-by: Dan Carpenter <[email protected]> Link: https://patch.msgid.link/e91fb43fcedc4893b604dfb973131661510901a7.1756456951.git.dan.carpenter@linaro.org Signed-off-by: Johannes Berg <[email protected]>
1 parent 629840e commit f8f15f6

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/wireless/st/cw1200

1 file changed

+1
-1
lines changed

drivers/net/wireless/st/cw1200/sta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ static void cw1200_do_join(struct cw1200_common *priv)
12911291
rcu_read_lock();
12921292
ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
12931293
if (ssidie) {
1294-
join.ssid_len = ssidie[1];
1294+
join.ssid_len = min(ssidie[1], IEEE80211_MAX_SSID_LEN);
12951295
memcpy(join.ssid, &ssidie[2], join.ssid_len);
12961296
}
12971297
rcu_read_unlock();

0 commit comments

Comments
 (0)