mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 05:38:15 +02:00
libnm: avoid assertion with invalid connections in _nm_connection_find_base_type_setting()
Functions should behave gracefully with connections that don't verify. Especially, as _normalize_connection_type() calls _nm_connection_find_base_type_setting() precisely with an unknown connection.type.
This commit is contained in:
parent
1d6b717401
commit
88c2ccfb4c
1 changed files with 7 additions and 4 deletions
|
|
@ -598,11 +598,14 @@ _nm_connection_find_base_type_setting (NMConnection *connection)
|
||||||
continue;
|
continue;
|
||||||
} else if (s_iter_prio == setting_prio) {
|
} else if (s_iter_prio == setting_prio) {
|
||||||
NMSettingConnection *s_con = nm_connection_get_setting_connection (connection);
|
NMSettingConnection *s_con = nm_connection_get_setting_connection (connection);
|
||||||
|
const char *type;
|
||||||
|
|
||||||
if (!s_con)
|
if (s_con) {
|
||||||
return NULL;
|
type = nm_setting_connection_get_connection_type (s_con);
|
||||||
return nm_connection_get_setting_by_name (connection,
|
if (type)
|
||||||
nm_setting_connection_get_connection_type (s_con));
|
return nm_connection_get_setting_by_name (connection, type);
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setting = s_iter;
|
setting = s_iter;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue