summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2017-10-18 17:33:34 -0400
committerPeter Jones <pmjones@gmail.com>2018-03-12 16:21:43 -0400
commit34e5043496d3b1d84fd434fa65c830c8eafd8dcd (patch)
tree90252f0b64c378e73269cba6feabd53ab24e5a6b
parenta32651360552559ee6a8978b5bcdc6e7dcc72b8c (diff)
downloadefi-boot-shim-34e5043496d3b1d84fd434fa65c830c8eafd8dcd.tar.gz
efi-boot-shim-34e5043496d3b1d84fd434fa65c830c8eafd8dcd.zip
MokManager: Fix a conditional on an uninitialized value in one error path.
clang-analyzer says: MokManager.c:1431:6: warning: Branch condition evaluates to a garbage value if (mok) ^~~ MokManager.c:1433:6: warning: Branch condition evaluates to a garbage value if (del_key) ^~~~~~~ And it's right; if we take the first error exit in the function, those never get initialized. This patch sets them to NULL to begin with. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--MokManager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/MokManager.c b/MokManager.c
index 16cf86fe..578c7249 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -1273,7 +1273,7 @@ static EFI_STATUS delete_keys(void *MokDel, UINTN MokDelSize, BOOLEAN MokX)
UINT32 attributes;
UINT8 *MokListData = NULL;
UINTN MokListDataSize = 0;
- MokListNode *mok, *del_key;
+ MokListNode *mok = NULL, *del_key = NULL;
INTN mok_num, del_num;
int i;