mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 18:35:42 +01:00 
			
		
		
		
	lib: libfdt: fdt_region: avoid NULL pointer access
The function fdt_find_regions look in the exclude list for each property, even if the name is NULL. It could happen if the fit image is corrupted. On sandbox, it generates a segfault. To avoid this issue, if the name of a property is NULL, we report an error and avoid looking in the exclude list. Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
		
				
					committed by
					
						 Simon Glass
						Simon Glass
					
				
			
			
				
	
			
			
			
						parent
						
							7058dd071a
						
					
				
				
					commit
					e8781dcc89
				
			| @@ -65,6 +65,8 @@ int fdt_find_regions(const void *fdt, char * const inc[], int inc_count, | |||||||
| 			stop_at = offset; | 			stop_at = offset; | ||||||
| 			prop = fdt_get_property_by_offset(fdt, offset, NULL); | 			prop = fdt_get_property_by_offset(fdt, offset, NULL); | ||||||
| 			str = fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); | 			str = fdt_string(fdt, fdt32_to_cpu(prop->nameoff)); | ||||||
|  | 			if (!str) | ||||||
|  | 				return -FDT_ERR_BADSTRUCTURE; | ||||||
| 			if (str_in_list(str, exc_prop, exc_prop_count)) | 			if (str_in_list(str, exc_prop, exc_prop_count)) | ||||||
| 				include = 0; | 				include = 0; | ||||||
| 			break; | 			break; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user