[PATCH] wpa_supplicant: fix a segfault in wpa_supplicant_deinit

Helmut Schaa helmut.schaa
Wed Feb 4 02:51:33 PST 2009


If wpa_supplicant is started with -u but the DBus service is already
registered wpa_supplicant will bail out. However, it will segfault
in wpa_supplicant_deinit because global->drv_priv wasn't allocated
yet.

Signed-off-by: Helmut Schaa <helmut.schaa at googlemail.com>
---

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index be40654..26dec1b 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -2199,7 +2199,7 @@ void wpa_supplicant_deinit(struct wpa_global *global)
 
 	eap_peer_unregister_methods();
 
-	for (i = 0; wpa_supplicant_drivers[i]; i++) {
+	for (i = 0; wpa_supplicant_drivers[i] && global->drv_priv; i++) {
 		if (!global->drv_priv[i])
 			continue;
 		wpa_supplicant_drivers[i]->global_deinit(global->drv_priv[i]);



More information about the Hostap mailing list