]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Check malloc success on workaround path
authorJouni Malinen <j@w1.fi>
Fri, 15 Jul 2011 11:21:50 +0000 (14:21 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 15 Jul 2011 11:21:50 +0000 (14:21 +0300)
ssid->ssid could be NULL here if malloc failed, so better check that
consistently.

wpa_supplicant/wps_supplicant.c

index e3388bd481a58dc4854c6fc9c96476906109431f..6f70cad84cbf3d52514e4d5b0e9e159bf14f0bc3 100644 (file)
@@ -127,6 +127,8 @@ static void wpas_wps_security_workaround(struct wpa_supplicant *wpa_s,
        if (wpa_drv_get_capa(wpa_s, &capa))
                return; /* Unknown what driver supports */
 
+       if (ssid->ssid == NULL)
+               return;
        bss = wpa_bss_get(wpa_s, cred->mac_addr, ssid->ssid, ssid->ssid_len);
        if (bss == NULL) {
                wpa_printf(MSG_DEBUG, "WPS: The AP was not found from BSS "