]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
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 d5145f0f2f15b5d92587986079f911169b762a74..cc05813fb73b683d3e6eb40687a241338eed2cb9 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);
 }