From: Jouni Malinen Date: Wed, 23 Dec 2009 21:16:21 +0000 (+0200) Subject: Avoid NULL dereference on error path when default driver is used X-Git-Tag: hostap_0_7_1~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5b9337fc88ea9ff4e85220c66a062da44f1c8e1;p=thirdparty%2Fhostap.git Avoid NULL dereference on error path when default driver is used --- diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index cfe99e868..0ad30abf2 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -2032,7 +2032,7 @@ next_driver: wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname); if (wpa_s->drv_priv == NULL) { const char *pos; - pos = os_strchr(driver, ','); + pos = driver ? os_strchr(driver, ',') : NULL; if (pos) { wpa_printf(MSG_DEBUG, "Failed to initialize driver " "interface - try next driver wrapper");