Skip to content
Commit 871ce778 authored by Michael Kubacki's avatar Michael Kubacki Committed by Nate DeSimone
Browse files

MinPlatformPkg/TestPointCheckLib: Fix DMAR structure length calculation

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3768



When processing DMAR structures of type
EFI_ACPI_DMAR_STRUCTURE_HEADER within the ACPI DMAR table, the code
determines the structure length by subtracting the DMAR structure
headers present from the overall DMAR ACPI table size.

The terminating condition is that the remaining total DMAR length
is greater than zero. However, the current DMAR structure length
is subtracted after the DMAR structure pointer has already been
assigned to the next structure.

This change subtracts the current DMAR structure length before
transitioning to the next structure.

The terminating condition is also updated to ensure the remaining
size is at least as large as the expected structure header size.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: default avatarMichael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: default avatarNate DeSimone <nathaniel.l.desimone@intel.com>
parent 4eaa1c8a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment