]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
hostapd: Check that EVENT_ASSOC data is present before using it
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 26 Aug 2014 14:23:02 +0000 (17:23 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 26 Aug 2014 14:23:02 +0000 (17:23 +0300)
While hostapd should not really receive the EVENT_ASSOC message for
IBSS, driver_nl80211.c could potentially generate that if something
external forces the interface into IBSS mode and the IBSS case does not
provide the struct assoc_info data. Avoid the potential NULL pointer
dereference by explicitly verifying for the event data to be present.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
src/ap/drv_callbacks.c

index 93804de0c83ea7f98af90fd487a62213ce41fa1d..ae4c968caad5c0ad908c87a85d2fc807c646d754 100644 (file)
@@ -1044,6 +1044,8 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                                       data->eapol_rx.data_len);
                break;
        case EVENT_ASSOC:
+               if (!data)
+                       return;
                hostapd_notif_assoc(hapd, data->assoc_info.addr,
                                    data->assoc_info.req_ies,
                                    data->assoc_info.req_ies_len,