mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +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:
		
				
					committed by
					
						
						Colin Walters
					
				
			
			
				
	
			
			
			
						parent
						
							375b4ca65c
						
					
				
				
					commit
					f4b5dc30a7
				
			@@ -178,11 +178,10 @@ 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);
 | 
			
		||||
      ret = closure->parse_name_func (vfs, parse_name,
 | 
			
		||||
                                      closure->parse_name_data);
 | 
			
		||||
 | 
			
		||||
      if (ret)
 | 
			
		||||
        break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user