mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
f3ac87a7f5
commit
879dbe18d8
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue