mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	cursor: Gracefully handle out of memory condition
If the full path could not be constructed, avoid calling opendir(NULL)
which, depending on library, might trigger undefined behavior.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
(cherry picked from commit ce0ac4f29e)
			
			
This commit is contained in:
		
							parent
							
								
									cd566cd232
								
							
						
					
					
						commit
						98d7bbee0a
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -686,11 +686,15 @@ load_all_cursors_from_dir(const char *path, int size,
 | 
			
		|||
			  void *user_data)
 | 
			
		||||
{
 | 
			
		||||
	FILE *f;
 | 
			
		||||
	DIR *dir = opendir(path);
 | 
			
		||||
	DIR *dir;
 | 
			
		||||
	struct dirent *ent;
 | 
			
		||||
	char *full;
 | 
			
		||||
	struct xcursor_images *images;
 | 
			
		||||
 | 
			
		||||
	if (!path)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	dir = opendir(path);
 | 
			
		||||
	if (!dir)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue