Fix ctrl_iface get-STA-MIB for WPS disabled case

The previous version would crash here on NULL pointer dereference if
WPS was disabled.
This commit is contained in:
Jouni Malinen 2010-03-29 09:59:16 -07:00 committed by Jouni Malinen
parent e2f74005f5
commit a042f8447d
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}