arrfab / rpms / shim

Forked from rpms/shim 4 years ago
Clone

Blame SOURCES/0072-Make-another-integer-compare-be-signed-unsigned-safe.patch

e97c83
From c622b677d67ebd88b94f13555b30da80ca74a8c1 Mon Sep 17 00:00:00 2001
e97c83
From: Peter Jones <pjones@redhat.com>
e97c83
Date: Sun, 21 Sep 2014 13:45:38 -0400
e97c83
Subject: [PATCH 72/74] Make another integer compare be signed/unsigned safe as
e97c83
 well.
e97c83
e97c83
Signed-off-by: Peter Jones <pjones@redhat.com>
e97c83
---
e97c83
 MokManager.c | 3 ++-
e97c83
 1 file changed, 2 insertions(+), 1 deletion(-)
e97c83
e97c83
diff --git a/MokManager.c b/MokManager.c
e97c83
index 4a9b102..ee29051 100644
e97c83
--- a/MokManager.c
e97c83
+++ b/MokManager.c
e97c83
@@ -192,7 +192,8 @@ static MokListNode *build_mok_list(UINT32 num, void *Data, UINTN DataSize) {
e97c83
 		list[count].Type = CertList->SignatureType;
e97c83
 
e97c83
 		/* MOK out of bounds? */
e97c83
-		if (list[count].MokSize > end - (void *)list[count].Mok) {
e97c83
+		if (list[count].MokSize > (unsigned long)end -
e97c83
+					  (unsigned long)list[count].Mok) {
e97c83
 			FreePool(list);
e97c83
 			return NULL;
e97c83
 		}
e97c83
-- 
e97c83
1.9.3
e97c83