Fix ctrl_iface get-STA-MIB for WPS disabled case
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 29 Mar 2010 16:59:16 +0000 (09:59 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 29 Mar 2010 16:59:16 +0000 (09:59 -0700)
The previous version would crash here on NULL pointer dereference if
WPS was disabled.

src/ap/wps_hostapd.c

index d5145f0..cc05813 100644 (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);
 }