diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2012-01-30 18:29:13 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2012-01-30 18:29:13 +0100 |
commit | b127fda19f9b81ec0bf3e8c6cd04bfcb8c7f30bf (patch) | |
tree | 5f4aa794a3e92255845a48871507484d0aa44343 | |
parent | 2c52303f59b2b4fa00a664a6b9757d841c58934b (diff) | |
download | NetworkManager-b127fda19f9b81ec0bf3e8c6cd04bfcb8c7f30bf.tar.gz |
supplicant: fix crash when connecting without both 'password' and 'password-raw'
It is the case e.g. for EAP-TLS. This regression was caused by commit
b08e2b8932ed6aa735b4ef4ed04fc173f275b16e.
-rw-r--r-- | src/supplicant-manager/nm-supplicant-config.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index 249ea9f58b..ecd06311e5 100644 --- a/src/supplicant-manager/nm-supplicant-config.c +++ b/src/supplicant-manager/nm-supplicant-config.c @@ -734,14 +734,16 @@ nm_supplicant_config_add_setting_8021x (NMSupplicantConfig *self, return FALSE; } else { array = nm_setting_802_1x_get_password_raw (setting); - success = nm_supplicant_config_add_option (self, - "password", - (const char *)array->data, - array->len, - TRUE); - if (!success) { - nm_log_warn (LOGD_SUPPLICANT, "Error adding password-raw to supplicant config."); - return FALSE; + if (array) { + success = nm_supplicant_config_add_option (self, + "password", + (const char *)array->data, + array->len, + TRUE); + if (!success) { + nm_log_warn (LOGD_SUPPLICANT, "Error adding password-raw to supplicant config."); + return FALSE; + } } } value = nm_setting_802_1x_get_pin (setting); |