fix: Check for possible NULL dereference introduced in #1695. (#1717)

PR #1695 possible NULL deregerence was triggering static analyzer failure.
Added a NULL check before dereferencing.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
This commit is contained in:
bejeanmo 2022-10-11 12:52:45 -04:00 committed by GitHub
parent 15f365d774
commit 2d73d46d09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -989,7 +989,9 @@ BuildExtraInfoHob (
TpmLibGetActivePcrBanks (&SecureBootInfoHob->TpmPcrActivePcrBanks);
if (LoaderPlatformInfo != NULL) {
SecureBootInfoHob->FirmwareDebuggerInitialized = ((LoaderPlatformInfo->HwState >> 2) || (LoaderPlatformInfo->HwState >> 3));
}
// SBL supports only TPM 2.0
if (SecureBootInfoHob->MeasuredBootEnabled) {