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
b08e2b8932.
This commit is contained in:
Jiří Klimeš
2012-01-30 18:29:13 +01:00
parent 2c52303f59
commit b127fda19f

View File

@@ -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);