mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 23:20:15 +01:00
ifcfg: make Coverity happy
CID 59382 (#1 of 1): Dereference null return value (NULL_RETURNS) 10. dereference: Dereferencing a pointer that might be null value when calling strcmp. Not exactly true, since we ruled out the posibility earlier; but we could still get rid of a couple of strcmps.
This commit is contained in:
parent
301c747938
commit
a77ec45110
1 changed files with 2 additions and 3 deletions
|
|
@ -3148,8 +3148,7 @@ make_wpa_setting (shvarFile *ifcfg,
|
|||
g_free (allow_rsn);
|
||||
}
|
||||
|
||||
/* coverity[dereference] */
|
||||
if (!strcmp (value, "WPA-PSK")) {
|
||||
if (wpa_psk) {
|
||||
NMSettingSecretFlags psk_flags;
|
||||
|
||||
psk_flags = read_secret_flags (ifcfg, "WPA_PSK_FLAGS");
|
||||
|
|
@ -3169,7 +3168,7 @@ make_wpa_setting (shvarFile *ifcfg,
|
|||
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-none", NULL);
|
||||
else
|
||||
g_object_set (wsec, NM_SETTING_WIRELESS_SECURITY_KEY_MGMT, "wpa-psk", NULL);
|
||||
} else if (!strcmp (value, "WPA-EAP") || !strcmp (value, "IEEE8021X")) {
|
||||
} else if (wpa_eap || ieee8021x) {
|
||||
/* Adhoc mode is mutually exclusive with any 802.1x-based authentication */
|
||||
if (adhoc) {
|
||||
g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue