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

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