mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 12:10:10 +01: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;
|
||||
} else if (s_iter_prio == setting_prio) {
|
||||
NMSettingConnection *s_con = nm_connection_get_setting_connection (connection);
|
||||
const char *type;
|
||||
|
||||
if (!s_con)
|
||||
return NULL;
|
||||
return nm_connection_get_setting_by_name (connection,
|
||||
nm_setting_connection_get_connection_type (s_con));
|
||||
if (s_con) {
|
||||
type = nm_setting_connection_get_connection_type (s_con);
|
||||
if (type)
|
||||
return nm_connection_get_setting_by_name (connection, type);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
setting = s_iter;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue