SecurityPkg/SecTpmMeasurementLib: Fix OverFlow Coverity issue

CC_MR_INDEX_0_MRTD indicates the MRTD register. This register is NOT
extendable in TDVF. So the return value of TdxMeasurementMapPcrToMrIndex
must be checked.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
This commit is contained in:
Ceping Sun 2025-07-01 02:01:50 -04:00 committed by mergify[bot]
parent d49364779c
commit 7c40bc06a9

View file

@ -58,7 +58,8 @@ TdxHashLogExtendEvent (
}
MrIndex = TdxMeasurementMapPcrToMrIndex (PcrIndex);
if (MrIndex == CC_MR_INDEX_INVALID) {
// MRTD is NOT extendable in TDVF.
if ((MrIndex == CC_MR_INDEX_INVALID) || (MrIndex == CC_MR_INDEX_0_MRTD)) {
return EFI_INVALID_PARAMETER;
}