summaryrefslogtreecommitdiff
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-29 01:19:20 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2012-11-29 01:19:20 +0000
commit879dbe18d8d56ae4dd6ca70b832eccf135b9514d (patch)
treefc7291b5f2d4521426826a5c9d3bf7a124030fcd /MdeModulePkg
parentf3ac87a7f50897b6be1494685f8d111cbfa405dc (diff)
downloadedk2-platforms-879dbe18d8d56ae4dd6ca70b832eccf135b9514d.tar.xz
Use mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE) to get the correct table length.
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@13977 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
index 5903b0f641..ee10655244 100644
--- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
+++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c
@@ -1989,13 +1989,10 @@ S3BootScriptCompare (
if (RelativePosition == NULL) {
return EFI_INVALID_PARAMETER;
}
- TableLength = ((EFI_BOOT_SCRIPT_TABLE_HEADER*)Script)->TableLength;
//
- // If in boot time, TableLength does not include the termination node. so add it up
+ // mS3BootScriptTablePtr->TableLength does not include the termination node, so add it up
//
- if (!mS3BootScriptTablePtr->AtRuntime) {
- TableLength += sizeof(EFI_BOOT_SCRIPT_TERMINATE);
- }
+ TableLength = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);
if (Position1 < Script || Position1 > Script+TableLength) {
return EFI_INVALID_PARAMETER;
}