summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2012-09-20 10:28:00 +0800
committerGary Ching-Pang Lin <glin@suse.com>2012-09-20 10:28:00 +0800
commitb3ff35663b1291bb4d3a726015e4cd8e6d0ce3fd (patch)
tree3804369b98b5566923ddad41534b929f92ec0320
parent1d7c0f860298c41ea005ec0c40dd813afe8bded9 (diff)
downloadefi-boot-shim-b3ff35663b1291bb4d3a726015e4cd8e6d0ce3fd.tar.gz
efi-boot-shim-b3ff35663b1291bb4d3a726015e4cd8e6d0ce3fd.zip
Check the MOK list correctly
-rw-r--r--shim.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/shim.c b/shim.c
index d91005c1..43297297 100644
--- a/shim.c
+++ b/shim.c
@@ -116,18 +116,18 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
ptr = Data;
for (i = 0; i < num; i++) {
+ CopyMem(&list[i].MokSize, ptr, sizeof(UINT32));
+ remain -= sizeof(UINT32) + list[i].MokSize;
+
if (remain < 0) {
Print(L"MOK list was corrupted\n");
FreePool(list);
return NULL;
}
- CopyMem(&list[i].MokSize, ptr, sizeof(UINT32));
ptr += sizeof(UINT32);
list[i].Mok = ptr;
ptr += list[i].MokSize;
-
- remain -= sizeof(UINT32) + list[i].MokSize;
}
return list;