mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-28 19:10:09 +01:00
keyfile: minor cleanup handling error in read_array_of_uint()
Why "if (length > G_MAXUINT)"? This is never going to hit. Also, we probably should actual missing keys handle differently from empty lists. If @error is set, return without setting the property.
This commit is contained in:
parent
8f46425b11
commit
2cf31bfef0
1 changed files with 3 additions and 2 deletions
|
|
@ -167,9 +167,10 @@ read_array_of_uint (GKeyFile *file,
|
|||
gsize length;
|
||||
gsize i;
|
||||
gs_free int *tmp = NULL;
|
||||
gs_free_error GError *error = NULL;
|
||||
|
||||
tmp = nm_keyfile_plugin_kf_get_integer_list (file, nm_setting_get_name (setting), key, &length, NULL);
|
||||
if (length > G_MAXUINT)
|
||||
tmp = nm_keyfile_plugin_kf_get_integer_list (file, nm_setting_get_name (setting), key, &length, &error);
|
||||
if (error)
|
||||
return;
|
||||
|
||||
array = g_array_sized_new (FALSE, FALSE, sizeof (guint), length);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue