mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 03:16:17 +01:00
gbookmarkfile: check length before dereferencing groups
There is no requirement that groups is NULL terminated, so we should check that the bounds are within the specified length before checking for a NULL terminating value. https://bugzilla.gnome.org/show_bug.cgi?id=792351
This commit is contained in:
parent
181d1c3052
commit
17e03effda
@ -2862,7 +2862,7 @@ g_bookmark_file_set_groups (GBookmarkFile *bookmark,
|
||||
|
||||
if (groups)
|
||||
{
|
||||
for (i = 0; groups[i] != NULL && i < length; i++)
|
||||
for (i = 0; i < length && groups[i] != NULL; i++)
|
||||
item->metadata->groups = g_list_append (item->metadata->groups,
|
||||
g_strdup (groups[i]));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user