Parcourir la source

wpa_supplicant AP: Make sure deauth/disassoc event is valid

Verify that the driver wrapper is using a valid deauth/disassoc
event before dereferencing the addr pointer. The address is required
to be set in AP mode, but it is safer to verify this here than to
trust on all driver wrappers doing the correct thing.
Jouni Malinen il y a 14 ans
Parent
commit
7f5420691e
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      wpa_supplicant/events.c

+ 2 - 2
wpa_supplicant/events.c

@@ -1500,7 +1500,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 					   MAC2STR(data->disassoc_info.addr));
 		}
 #ifdef CONFIG_AP
-		if (wpa_s->ap_iface && data) {
+		if (wpa_s->ap_iface && data && data->disassoc_info.addr) {
 			hostapd_notif_disassoc(wpa_s->ap_iface->bss[0],
 					       data->disassoc_info.addr);
 			break;
@@ -1527,7 +1527,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 			}
 		}
 #ifdef CONFIG_AP
-		if (wpa_s->ap_iface && data) {
+		if (wpa_s->ap_iface && data && data->deauth_info.addr) {
 			hostapd_notif_disassoc(wpa_s->ap_iface->bss[0],
 					       data->deauth_info.addr);
 			break;