diff options
author | Chao Zhang <chao.b.zhang@intel.com> | 2016-01-27 02:46:51 +0000 |
---|---|---|
committer | czhang46 <czhang46@Edk2> | 2016-01-27 02:46:51 +0000 |
commit | e8cd9b804126aabe15cd53ec44b7ff4c7e95763b (patch) | |
tree | 6232c194aa5dcc11e9fd96432e7ef8b36114f0c4 /SecurityPkg/VariableAuthenticated | |
parent | cb312fb1f7fc6d1efc50d569fb33a21d28480c20 (diff) | |
download | edk2-platforms-e8cd9b804126aabe15cd53ec44b7ff4c7e95763b.tar.xz |
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
Diffstat (limited to 'SecurityPkg/VariableAuthenticated')
-rw-r--r-- | SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c index e0f934bbb4..e2340e6302 100644 --- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c +++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.c @@ -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) {
|