summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-27 11:20:01 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-27 11:20:01 +0000
commitd03b313050ddeb4146e514e30178b50cfe91dd9c (patch)
tree8490176781784459d292823495fc415820d637ce /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
parenta332cfd308b9da316e72562d2198c44e134c1481 (diff)
downloadedk2-d03b313050ddeb4146e514e30178b50cfe91dd9c.zip
edk2-d03b313050ddeb4146e514e30178b50cfe91dd9c.tar.gz
edk2-d03b313050ddeb4146e514e30178b50cfe91dd9c.tar.bz2
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
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index 32c7a55..5903b0f 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -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
//