mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
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:
parent
cb312fb1f7
commit
e8cd9b8041
@ -3075,16 +3075,17 @@ EFI_STATUS
|
|||||||
UpdateSecureBootString(
|
UpdateSecureBootString(
|
||||||
IN SECUREBOOT_CONFIG_PRIVATE_DATA *Private
|
IN SECUREBOOT_CONFIG_PRIVATE_DATA *Private
|
||||||
) {
|
) {
|
||||||
EFI_STATUS Status;
|
|
||||||
UINT8 CurSecureBootMode;
|
UINT8 CurSecureBootMode;
|
||||||
UINT8 *SecureBoot;
|
UINT8 *SecureBoot;
|
||||||
|
|
||||||
|
SecureBoot = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Get current secure boot state.
|
// Get current secure boot state.
|
||||||
//
|
//
|
||||||
Status = GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBoot, NULL);
|
GetVariable2 (EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid, (VOID**)&SecureBoot, NULL);
|
||||||
if (EFI_ERROR(Status)) {
|
if (SecureBoot == NULL) {
|
||||||
return Status;
|
return EFI_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*SecureBoot == SECURE_BOOT_MODE_ENABLE) {
|
if (*SecureBoot == SECURE_BOOT_MODE_ENABLE) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user