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:
@ -1989,13 +1989,10 @@ S3BootScriptCompare (
|
|||||||
if (RelativePosition == NULL) {
|
if (RelativePosition == NULL) {
|
||||||
return EFI_INVALID_PARAMETER;
|
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 = mS3BootScriptTablePtr->TableLength + sizeof (EFI_BOOT_SCRIPT_TERMINATE);
|
||||||
TableLength += sizeof(EFI_BOOT_SCRIPT_TERMINATE);
|
|
||||||
}
|
|
||||||
if (Position1 < Script || Position1 > Script+TableLength) {
|
if (Position1 < Script || Position1 > Script+TableLength) {
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user