From 04a258e7c56202ca285dd4d9459fdb45754401fe Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 26 Aug 2014 17:23:02 +0300 Subject: [PATCH] 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 --- src/ap/drv_callbacks.c | 2 ++ 1 file changed, 2 insertions(+) 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,