]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MSCS: Fix decapsulating subelements from MSCS descriptor
authorVamsi Krishna <vamsin@codeaurora.org>
Tue, 13 Oct 2020 15:51:13 +0000 (21:21 +0530)
committerJouni Malinen <j@w1.fi>
Wed, 14 Oct 2020 20:09:13 +0000 (23:09 +0300)
Fix pointer sent for decapsulating subelements from MSCS descriptor
IE while processing (re)association response frames.

Fixes: af8ab3208d03 ("MSCS: Parse result of MSCS setup in (Re)Association Response frames")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
wpa_supplicant/robust_av.c

index 4ac1a2bb90e199271a894da08308cb0f9bf7f280..1280f5d96e7e29a35a95691346d1407a136e3acf 100644 (file)
@@ -142,10 +142,13 @@ void wpas_handle_assoc_resp_mscs(struct wpa_supplicant *wpa_s, const u8 *bssid,
                return;
 
        mscs_desc_ie = get_ie_ext(ies, ies_len, WLAN_EID_EXT_MSCS_DESCRIPTOR);
-       if (!mscs_desc_ie || mscs_desc_ie[1] < 1)
+       if (!mscs_desc_ie || mscs_desc_ie[1] <= 8)
                return;
 
-       mscs_status = get_ie(mscs_desc_ie, mscs_desc_ie[1],
+       /* Subelements start after (ie_id(1) + ie_len(1) + ext_id(1) +
+        * request type(1) + upc(2) + stream timeout(4) =) 10.
+        */
+       mscs_status = get_ie(&mscs_desc_ie[10], mscs_desc_ie[1] - 8,
                             MCSC_SUBELEM_STATUS);
        if (!mscs_status || mscs_status[1] < 2)
                return;