From d87e90b646aa9c63d334f3b48dcdc60dc13ed96e Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 15 Jul 2011 14:21:50 +0300 Subject: [PATCH] WPS: Check malloc success on workaround path ssid->ssid could be NULL here if malloc failed, so better check that consistently. --- wpa_supplicant/wps_supplicant.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index e3388bd48..6f70cad84 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -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 "