arrfab / rpms / shim

Forked from rpms/shim 4 years ago
Clone

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

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