SHA256
1
0
forked from pool/pesign
pesign/pesign-bsc1087742-fix-efisiglist.patch

34 lines
1.0 KiB
Diff

From 4279d9a36d6c0d09295a76160e26cbe1bbf37591 Mon Sep 17 00:00:00 2001
From: Gary Lin <glin@suse.com>
Date: Fri, 30 Mar 2018 12:25:34 +0800
Subject: [PATCH] efisiglist: Copy the header correctly
signature_list wasn't copied corretly to efi_signature_list because
SignatureType in signature_list is a pointer while that in
efi_signature_list is not.
Signed-off-by: Gary Lin <glin@suse.com>
---
src/siglist.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/siglist.c b/src/siglist.c
index 6e59164..e74eb10 100644
--- a/src/siglist.c
+++ b/src/siglist.c
@@ -217,7 +217,10 @@ signature_list_realize(signature_list *sl, void **out, size_t *outsize)
return -1;
esl = ret;
- memcpy(esl, sl, sizeof (*esl));
+ memcpy(&esl->SignatureType, sl->SignatureType, sizeof(efi_guid_t));
+ esl->SignatureListSize = sl->SignatureListSize;
+ esl->SignatureHeaderSize = sl->SignatureHeaderSize;
+ esl->SignatureSize = sl->SignatureSize;
uint8_t *pos = ret + sizeof (*esl);
for (int i = 0; i < count; i++) {
--
2.16.2