Browse 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 14 years ago
parent
commit
7f5420691e
1 changed files with 2 additions and 2 deletions
  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));
 					   MAC2STR(data->disassoc_info.addr));
 		}
 		}
 #ifdef CONFIG_AP
 #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],
 			hostapd_notif_disassoc(wpa_s->ap_iface->bss[0],
 					       data->disassoc_info.addr);
 					       data->disassoc_info.addr);
 			break;
 			break;
@@ -1527,7 +1527,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
 			}
 			}
 		}
 		}
 #ifdef CONFIG_AP
 #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],
 			hostapd_notif_disassoc(wpa_s->ap_iface->bss[0],
 					       data->deauth_info.addr);
 					       data->deauth_info.addr);
 			break;
 			break;