Parcourir la source

Fix ctrl_iface get-STA-MIB for WPS disabled case

The previous version would crash here on NULL pointer dereference if
WPS was disabled.
Jouni Malinen il y a 15 ans
Parent
commit
a042f8447d
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      src/ap/wps_hostapd.c

+ 2 - 0
src/ap/wps_hostapd.c

@@ -894,5 +894,7 @@ static void hostapd_wps_upnp_deinit(struct hostapd_data *hapd)
 int hostapd_wps_get_mib_sta(struct hostapd_data *hapd, const u8 *addr,
 			    char *buf, size_t buflen)
 {
+	if (hapd->wps == NULL)
+		return 0;
 	return wps_registrar_get_info(hapd->wps->registrar, addr, buf, buflen);
 }