carl9170 firmware: add missing out-of-bound check in WoWLAN code
authorChristian Lamparter <chunkeey@googlemail.com>
Wed, 17 Aug 2011 11:15:06 +0000 (13:15 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Wed, 17 Aug 2011 11:15:06 +0000 (13:15 +0200)
src/wlan.c: In function ‘wlan_rx_wol_probe_ssid’:
src/wlan.c:830:30: error: variable ‘end’ set but not used

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
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;
                }