summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/wfx/sta.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 5d5c8951f50b..f3e106f7eeac 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -351,7 +351,9 @@ static void wfx_do_join(struct wfx_vif *wvif)
ssidie = ieee80211_bss_get_ie(bss, WLAN_EID_SSID);
if (ssidie) {
ssidlen = ssidie[1];
- memcpy(ssid, &ssidie[2], ssidie[1]);
+ if (ssidlen > IEEE80211_MAX_SSID_LEN)
+ ssidlen = IEEE80211_MAX_SSID_LEN;
+ memcpy(ssid, &ssidie[2], ssidlen);
}
rcu_read_unlock();