mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 14:20:17 +01:00
libnm: fix update of cached option names in nm_setting_option_set()
This is severe. We cache the list of names, and we must invalidate the cache when the names change. Otherwise, out-of-bound access and crash. Fixes:d0192b698e('libnm: add nm_setting_option_set(), nm_setting_option_get_boolean(), nm_setting_option_set_boolean()') Fixes:150af44e10('libnm: add nm_setting_option_get_uint32(), nm_setting_option_set_uint32()')
This commit is contained in:
parent
681926ad43
commit
22dcfb3a67
1 changed files with 3 additions and 3 deletions
|
|
@ -3975,7 +3975,7 @@ nm_setting_option_set(NMSetting *setting, const char *opt_name, GVariant *varian
|
|||
g_hash_table_insert(hash, g_strdup(opt_name), g_variant_ref_sink(variant));
|
||||
|
||||
if (changed_value)
|
||||
_nm_setting_option_notify(setting, !changed_name);
|
||||
_nm_setting_option_notify(setting, changed_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4012,7 +4012,7 @@ nm_setting_option_set_boolean(NMSetting *setting, const char *opt_name, gboolean
|
|||
g_hash_table_insert(hash, g_strdup(opt_name), g_variant_ref_sink(g_variant_new_boolean(value)));
|
||||
|
||||
if (changed_value)
|
||||
_nm_setting_option_notify(setting, !changed_name);
|
||||
_nm_setting_option_notify(setting, changed_name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4047,7 +4047,7 @@ nm_setting_option_set_uint32(NMSetting *setting, const char *opt_name, guint32 v
|
|||
g_hash_table_insert(hash, g_strdup(opt_name), g_variant_ref_sink(g_variant_new_uint32(value)));
|
||||
|
||||
if (changed_value)
|
||||
_nm_setting_option_notify(setting, !changed_name);
|
||||
_nm_setting_option_notify(setting, changed_name);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue