Browse Source

Avoid NULL dereference on error path when default driver is used

Jouni Malinen 15 years ago
parent
commit
a5b9337fc8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      wpa_supplicant/wpa_supplicant.c

+ 1 - 1
wpa_supplicant/wpa_supplicant.c

@@ -2032,7 +2032,7 @@ next_driver:
 	wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);
 	wpa_s->drv_priv = wpa_drv_init(wpa_s, wpa_s->ifname);
 	if (wpa_s->drv_priv == NULL) {
 	if (wpa_s->drv_priv == NULL) {
 		const char *pos;
 		const char *pos;
-		pos = os_strchr(driver, ',');
+		pos = driver ? os_strchr(driver, ',') : NULL;
 		if (pos) {
 		if (pos) {
 			wpa_printf(MSG_DEBUG, "Failed to initialize driver "
 			wpa_printf(MSG_DEBUG, "Failed to initialize driver "
 				   "interface - try next driver wrapper");
 				   "interface - try next driver wrapper");