diff options
author | Mohamed Abbas <mabbas@linux.intel.com> | 2010-12-23 13:28:47 -0800 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-12-23 23:35:50 +0100 |
commit | c8cd6c98e453d5f9edfd058ccd30cdc16581d4f6 (patch) | |
tree | e5f141c8ffd53e1dd5b79cf5abe065f73eaef8e6 | |
parent | b4ebacbab72e33c87629ca7089dc44b06a83eff2 (diff) | |
download | connman-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.c | 2 |
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; |