carl9170 firmware: add missing out-of-bound check in WoWLAN code
[carl9170fw.git] / carlfw / src / wlan.c
index 50b1f2bb8b77c773903ed871ede9337bd5e25d95..1b895364358f8c83c20179fe2c2d3a03a214e6e3 100644 (file)
@@ -845,7 +845,7 @@ static bool wlan_rx_wol_probe_ssid(struct ieee80211_hdr *hdr, unsigned int len)
                 */
                data = (u8 *)((struct ieee80211_mgmt *)hdr)->u.probe_req.variable;
                for (i = 0; i < (unsigned int)(probe_req.ssid_len + 1); i++) {
-                       if (scan[i] != data[i])
+                       if (data > end || scan[i] != data[i])
                                return false;
                }