mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-14 09:53:12 +02:00
gdesktopappinfo: fix a crasher
During the time that we are expanding the strv, it is not null-terminated. Use the strv_len variable instead to bound the search for duplicates.
This commit is contained in:
parent
7916f6d636
commit
afaee8dc6a
@ -663,7 +663,7 @@ expand_strv (gchar ***strv_ptr,
|
||||
goto no_add;
|
||||
|
||||
/* Don't add duplicates already in the list */
|
||||
for (j = 0; strv[j]; j++)
|
||||
for (j = 0; j < strv_len; j++)
|
||||
if (g_str_equal (to_add[i], strv[j]))
|
||||
goto no_add;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user