mirror of
				https://gitlab.freedesktop.org/wayland/wayland.git
				synced 2025-11-03 09:01:42 -05:00 
			
		
		
		
	cursor: Ignore invalid cursor files
The header offset must not be smaller than file header length.
Ignore such invalid files.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
(cherry picked from commit 2978fd701a)
			
			
This commit is contained in:
		
							parent
							
								
									65ce8920e2
								
							
						
					
					
						commit
						86cfd575ca
					
				
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -259,6 +259,8 @@ xcursor_read_file_header(FILE *file)
 | 
			
		|||
		return NULL;
 | 
			
		||||
	if (!xcursor_read_uint(file, &head.ntoc))
 | 
			
		||||
		return NULL;
 | 
			
		||||
	if (head.header < XCURSOR_FILE_HEADER_LEN)
 | 
			
		||||
		return NULL;
 | 
			
		||||
	skip = head.header - XCURSOR_FILE_HEADER_LEN;
 | 
			
		||||
	if (skip)
 | 
			
		||||
		if (fseek(file, skip, SEEK_CUR) == EOF)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue