summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohamed Abbas <mabbas@linux.intel.com>2010-12-23 13:28:47 -0800
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-23 23:35:50 +0100
commitc8cd6c98e453d5f9edfd058ccd30cdc16581d4f6 (patch)
treee5f141c8ffd53e1dd5b79cf5abe065f73eaef8e6
parentb4ebacbab72e33c87629ca7089dc44b06a83eff2 (diff)
downloadconnman-c8cd6c98e453d5f9edfd058ccd30cdc16581d4f6.tar.gz
connman-c8cd6c98e453d5f9edfd058ccd30cdc16581d4f6.tar.bz2
connman-c8cd6c98e453d5f9edfd058ccd30cdc16581d4f6.zip
wifi: Check for passphrase being not NULL before calling strlen
It seems strlen(passphrase) was crashing on NULL passphrase.
-rw-r--r--plugins/wifi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 754b8b9b..62d9216b 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;