arrfab / rpms / shim

Forked from rpms/shim 5 years ago
Clone

Blame SOURCES/0017-Error-check-the-right-thing-in-get_variable_attr-whe.patch

f2fa6b
From 293f28d1fe3921c5348c60948b4dedcef5042d5b Mon Sep 17 00:00:00 2001
f2fa6b
From: Peter Jones <pjones@redhat.com>
f2fa6b
Date: Fri, 15 Nov 2013 10:55:37 -0500
f2fa6b
Subject: [PATCH 17/19] Error check the right thing in get_variable_attr() when
f2fa6b
 allocating.
f2fa6b
f2fa6b
Signed-off-by: Peter Jones <pjones@redhat.com>
f2fa6b
---
f2fa6b
 lib/variables.c | 2 +-
f2fa6b
 1 file changed, 1 insertion(+), 1 deletion(-)
f2fa6b
f2fa6b
diff --git a/lib/variables.c b/lib/variables.c
f2fa6b
index 81bd34d..3a9735e 100644
f2fa6b
--- a/lib/variables.c
f2fa6b
+++ b/lib/variables.c
f2fa6b
@@ -224,7 +224,7 @@ get_variable_attr(CHAR16 *var, UINT8 **data, UINTN *len, EFI_GUID owner,
f2fa6b
 		return efi_status;
f2fa6b
 
f2fa6b
 	*data = AllocateZeroPool(*len);
f2fa6b
-	if (!data)
f2fa6b
+	if (!*data)
f2fa6b
 		return EFI_OUT_OF_RESOURCES;
f2fa6b
 	
f2fa6b
 	efi_status = uefi_call_wrapper(RT->GetVariable, 5, var, &owner,
f2fa6b
-- 
f2fa6b
1.8.5.3
f2fa6b