From b127fda19f9b81ec0bf3e8c6cd04bfcb8c7f30bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Mon, 30 Jan 2012 18:29:13 +0100 Subject: [PATCH] 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. --- src/supplicant-manager/nm-supplicant-config.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/supplicant-manager/nm-supplicant-config.c b/src/supplicant-manager/nm-supplicant-config.c index 249ea9f58..ecd06311e 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);