From a5b9337fc88ea9ff4e85220c66a062da44f1c8e1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 23 Dec 2009 23:16:21 +0200 Subject: [PATCH] Avoid NULL dereference on error path when default driver is used --- wpa_supplicant/wpa_supplicant.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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");