dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0279-grub-module-verifier-fix-unintended-sign-extension.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrei Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Fri, 8 Jan 2016 11:05:16 +0300
f725e3
Subject: [PATCH] grub-module-verifier: fix unintended sign extension
f725e3
f725e3
Found by: Coverity scan.
f725e3
CID: 156533, 156532
f725e3
---
f725e3
 util/grub-module-verifierXX.c | 2 +-
f725e3
 1 file changed, 1 insertion(+), 1 deletion(-)
f725e3
f725e3
diff --git a/util/grub-module-verifierXX.c b/util/grub-module-verifierXX.c
f725e3
index 25988ebc21d..f612d51f389 100644
f725e3
--- a/util/grub-module-verifierXX.c
f725e3
+++ b/util/grub-module-verifierXX.c
f725e3
@@ -337,7 +337,7 @@ SUFFIX(grub_module_verify) (void *module_img, size_t size, const struct grub_mod
f725e3
 
f725e3
   /* Make sure that every section is within the core.  */
f725e3
   if (size < grub_target_to_host (e->e_shoff)
f725e3
-      + grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum))
f725e3
+      + (grub_uint32_t) grub_target_to_host16 (e->e_shentsize) * grub_target_to_host16(e->e_shnum))
f725e3
     {
f725e3
       grub_util_error ("ELF sections outside core");
f725e3
     }