Add the memory check to reserve memory for TERMINATE opcode in S3BootScriptGetBootTimeEntryAddAddress.
Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13965 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
		@@ -542,7 +542,7 @@ S3BootScriptGetBootTimeEntryAddAddress (
 | 
			
		||||
   // Here we do not count the reserved memory for runtime script table.
 | 
			
		||||
   PageNumber   = (UINT16)(mS3BootScriptTablePtr->TableMemoryPageNumber - PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));   
 | 
			
		||||
   TableLength =  mS3BootScriptTablePtr->TableLength;
 | 
			
		||||
   if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength)) {
 | 
			
		||||
   if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) {
 | 
			
		||||
     // 
 | 
			
		||||
     // The buffer is too small to hold the table, Reallocate the buffer
 | 
			
		||||
     //
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user