SecurityPkg: SecureBootConfigDxe: Fix potential NULL pointer dereference

Fix SecureBoot potential NULL pointer dereference.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19751 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Chao Zhang 2016-01-27 02:46:51 +00:00 committed by czhang46
parent cb312fb1f7
commit e8cd9b8041
1 changed files with 5 additions and 4 deletions

View File

@ -3075,16 +3075,17 @@ EFI_STATUS
UpdateSecureBootString(
IN SECUREBOOT_CONFIG_PRIVATE_DATA *Private
) {
EFI_STATUS Status;
UINT8 CurSecureBootMode;
UINT8 *SecureBoot;
SecureBoot = NULL;
//
// Get current secure boot state.
//
Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBoot, NULL);
if (EFI_ERROR(Status)) {
return Status;
GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBoot, NULL);
if (SecureBoot == NULL) {
return EFI_NOT_FOUND;
}
if (*SecureBoot == SECURE_BOOT_MODE_ENABLE) {