Blame SOURCES/0280-mkimage-fix-unintended-sign-extension.patch

d41074
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
d41074
From: Andrei Borzenkov <arvidjaar@gmail.com>
d41074
Date: Sat, 9 Jan 2016 21:05:44 +0300
d41074
Subject: [PATCH] mkimage: fix unintended sign extension
d41074
d41074
Found by: Coverity scan.
d41074
CID: 73691, 73717
d41074
---
d41074
 util/grub-mkimagexx.c | 2 +-
d41074
 1 file changed, 1 insertion(+), 1 deletion(-)
d41074
d41074
diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
d41074
index 0a1ac9e517c..66e8576411e 100644
d41074
--- a/util/grub-mkimagexx.c
d41074
+++ b/util/grub-mkimagexx.c
d41074
@@ -1465,7 +1465,7 @@ SUFFIX (load_image) (const char *kernel_path, size_t *exec_size,
d41074
   section_entsize = grub_target_to_host16 (e->e_shentsize);
d41074
   num_sections = grub_target_to_host16 (e->e_shnum);
d41074
 
d41074
-  if (kernel_size < section_offset + section_entsize * num_sections)
d41074
+  if (kernel_size < section_offset + (grub_uint32_t) section_entsize * num_sections)
d41074
     grub_util_error (_("premature end of file %s"), kernel_path);
d41074
 
d41074
   sections = (Elf_Shdr *) (kernel_img + section_offset);