mirror of
				https://git.proxmox.com/git/efi-boot-shim
				synced 2025-10-31 10:27:28 +00:00 
			
		
		
		
	Check the MOK list correctly
This commit is contained in:
		
							parent
							
								
									1d7c0f8602
								
							
						
					
					
						commit
						b3ff35663b
					
				
							
								
								
									
										6
									
								
								shim.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								shim.c
									
									
									
									
									
								
							| @ -116,18 +116,18 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) { | ||||
| 
 | ||||
| 	ptr = Data; | ||||
| 	for (i = 0; i < num; i++) { | ||||
| 		CopyMem(&list[i].MokSize, ptr, sizeof(UINT32)); | ||||
| 		remain -= sizeof(UINT32) + list[i].MokSize; | ||||
| 
 | ||||
| 		if (remain < 0) { | ||||
| 			Print(L"MOK list was corrupted\n"); | ||||
| 			FreePool(list); | ||||
| 			return NULL; | ||||
| 		} | ||||
| 
 | ||||
| 		CopyMem(&list[i].MokSize, ptr, sizeof(UINT32)); | ||||
| 		ptr += sizeof(UINT32); | ||||
| 		list[i].Mok = ptr; | ||||
| 		ptr += list[i].MokSize; | ||||
| 
 | ||||
| 		remain -= sizeof(UINT32) + list[i].MokSize; | ||||
| 	} | ||||
| 
 | ||||
| 	return list; | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Gary Ching-Pang Lin
						Gary Ching-Pang Lin