]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FT: Fix potential NULL pointer dereference in MDE addition
authorJouni Malinen <j@w1.fi>
Tue, 5 Jun 2018 11:40:18 +0000 (14:40 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 5 Jun 2018 17:16:37 +0000 (20:16 +0300)
The bss variable in this function might be NULL, so make the FT MDE
addition case conditional on a BSS entry being available.

Fixes: 3dc3afe298f0 ("FT: Add MDE to assoc request IEs in connect params")
Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/wpa_supplicant.c

index 11d6b20b350c2661f2033b7b565de189a3f55e9c..185a8d50fbcf8b21aa6008366cd1a4a21fd5e223 100644 (file)
@@ -2748,7 +2748,7 @@ static u8 * wpas_populate_assoc_ies(
         * Add MDIE under these conditions: the network profile allows FT,
         * the AP supports FT, and the mobility domain ID matches.
         */
-       if (wpa_key_mgmt_ft(wpa_sm_get_key_mgmt(wpa_s->wpa))) {
+       if (bss && wpa_key_mgmt_ft(wpa_sm_get_key_mgmt(wpa_s->wpa))) {
                const u8 *mdie = wpa_bss_get_ie(bss, WLAN_EID_MOBILITY_DOMAIN);
 
                if (mdie && mdie[1] >= MOBILITY_DOMAIN_ID_LEN) {