]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
cbfs: Fix corner case and compilation with recdent gcc
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 9 Nov 2015 02:24:04 +0000 (03:24 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 9 Nov 2015 02:24:04 +0000 (03:24 +0100)
Accept the header to touch the jump address at 0xfffffff0.

Fix compilation for 64-bit EFI with recent GCC.

grub-core/fs/cbfs.c

index 5fc9c0147c42f933c11433c06d5309f58cd8e4ea..0842701a60a0dc38bf0b653de7711acb0c56533d 100644 (file)
@@ -352,7 +352,7 @@ init_cbfsdisk (void)
      reading ROMs through controller directly.
    */
   if (ptr < 0xff000000
-      || 0xffffffff - ptr < sizeof (*head) + 0x10
+      || 0xffffffff - ptr < (grub_uint32_t) sizeof (*head) + 0xf
       || !validate_head (head))
     return;