From f1005559ec0ab65d42526313eb819f60c120eab8 Mon Sep 17 00:00:00 2001 From: "Zhang, Chao B" Date: Tue, 10 May 2016 15:50:02 +0800 Subject: SecurityPkg: SecureBootConfigDxe: Add NULL pointer check Add SecureBoot NULL pointer check before reference it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang Reviewed-by: Samer El-Haj-Mahmoud Reviewed-by: Qiu Shumin --- .../VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'SecurityPkg/VariableAuthenticated') diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c index 088fa26e0d..3f80441602 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c @@ -2933,7 +2933,7 @@ SecureBootExtractConfigFromVariable ( // // Fix Pk, SecureBootEnable inconsistence // - if ((*SetupMode) == USER_MODE) { + if ((SetupMode != NULL) && (*SetupMode) == USER_MODE) { ConfigData->HideSecureBoot = FALSE; if ((SecureBootEnable != NULL) && (*SecureBootEnable == SECURE_BOOT_ENABLE)) { ConfigData->AttemptSecureBoot = TRUE; -- cgit v1.2.3