]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add the memory check to reserve memory for TERMINATE opcode in S3BootScriptGetBootTim...
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Nov 2012 11:20:01 +0000 (11:20 +0000)
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 27 Nov 2012 11:20:01 +0000 (11:20 +0000)
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

MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c

index 32c7a55ac2bf67f0331434f2167df1c30f7a9d08..5903b0f6413a5ad5cc49115c958690c62300fbed 100644 (file)
@@ -542,7 +542,7 @@ S3BootScriptGetBootTimeEntryAddAddress (
    // Here we do not count the reserved memory for runtime script table.\r
    PageNumber   = (UINT16)(mS3BootScriptTablePtr->TableMemoryPageNumber - PcdGet16(PcdS3BootScriptRuntimeTableReservePageNumber));   \r
    TableLength =  mS3BootScriptTablePtr->TableLength;\r
-   if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength)) {\r
+   if ((UINT32)(PageNumber * EFI_PAGE_SIZE) < (TableLength + EntryLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE))) {\r
      // \r
      // The buffer is too small to hold the table, Reallocate the buffer\r
      //\r