diff options
author | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-11-27 11:20:01 +0000 |
---|---|---|
committer | lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> | 2012-11-27 11:20:01 +0000 |
commit | d03b313050ddeb4146e514e30178b50cfe91dd9c (patch) | |
tree | 8490176781784459d292823495fc415820d637ce /MdeModulePkg | |
parent | a332cfd308b9da316e72562d2198c44e134c1481 (diff) | |
download | edk2-platforms-d03b313050ddeb4146e514e30178b50cfe91dd9c.tar.xz |
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')
-rw-r--r-- | MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c index 32c7a55ac2..5903b0f641 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
//
|