mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 07:26:15 +01:00
gvfs: fix possible infinite loop in parse_name_internal()
If none of the closures in the hash table return a non-null value, the loop never ends. Since the end of the hash table has been reached at that point, g_hash_table_iter_next() starts asserting. The possible fix is making the return value of g_hash_table_iter_next() the condition in the loop. https://bugzilla.gnome.org/show_bug.cgi?id=768029
This commit is contained in:
parent
375b4ca65c
commit
f4b5dc30a7
@ -178,9 +178,8 @@ parse_name_internal (GVfs *vfs,
|
||||
g_rw_lock_reader_lock (&additional_schemes_lock);
|
||||
g_hash_table_iter_init (&iter, priv->additional_schemes);
|
||||
|
||||
while (TRUE)
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &closure))
|
||||
{
|
||||
if (g_hash_table_iter_next (&iter, NULL, (gpointer *) &closure))
|
||||
ret = closure->parse_name_func (vfs, parse_name,
|
||||
closure->parse_name_data);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user