From c8cd6c98e453d5f9edfd058ccd30cdc16581d4f6 Mon Sep 17 00:00:00 2001 From: Mohamed Abbas Date: Thu, 23 Dec 2010 13:28:47 -0800 Subject: [PATCH] wifi: Check for passphrase being not NULL before calling strlen It seems strlen(passphrase) was crashing on NULL passphrase. --- plugins/wifi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/wifi.c b/plugins/wifi.c index 754b8b9..62d9216 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -608,7 +608,7 @@ static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network) ssid->security = network_security(security); passphrase = connman_network_get_string(network, "WiFi.Passphrase"); - if (strlen(passphrase) == 0) + if (passphrase == NULL || strlen(passphrase) == 0) ssid->passphrase = NULL; else ssid->passphrase = passphrase; -- 2.7.4