mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 01:58:54 +01:00 
			
		
		
		
	GUnixFDMessage: fix a small typo in an extra check
In the deserialise function, GUnixFDMessage was comparing 'level' to both SOL_SOCKET and SCM_RIGHTS. It is correct to compare 'type' to SCM_RIGHTS. The code passed tests only because: 1) it's a "should always be OK" double-check 2) SOL_SOCKET and SCM_RIGHTS, by chance, both have the value '1' on Linux systems.
This commit is contained in:
		@@ -84,7 +84,7 @@ g_unix_fd_message_deserialize (int      level,
 | 
			
		||||
  gint *fds;
 | 
			
		||||
 | 
			
		||||
  if (level != SOL_SOCKET ||
 | 
			
		||||
      level != SCM_RIGHTS)
 | 
			
		||||
      type != SCM_RIGHTS)
 | 
			
		||||
    return NULL;
 | 
			
		||||
  
 | 
			
		||||
  if (size % 4 > 0)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user