From: Jouni Malinen Date: Tue, 26 Aug 2014 14:23:02 +0000 (+0300) Subject: hostapd: Check that EVENT_ASSOC data is present before using it X-Git-Tag: hostap_2_3~136 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04a258e7c56202ca285dd4d9459fdb45754401fe;p=thirdparty%2Fhostap.git hostapd: Check that EVENT_ASSOC data is present before using it 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 --- diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c index 93804de0c..ae4c968ca 100644 --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c @@ -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,