]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
loader/i386/linux: Do not use grub_le_to_cpu32() for relocatable variable
authorTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Mon, 11 Jan 2021 03:04:36 +0000 (11:04 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 16:46:13 +0000 (17:46 +0100)
The relocatable variable is defined as grub_uint8_t. Relevant
member in setup_header structure is also defined as one byte
in Linux boot protocol. By semantic definition it is a bool type.
It is not appropriate to treat it as a four bytes. This patch
fixes the issue.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/i386/linux.c

index 0eea64a2073fd156fc68199d5904d595a04e0254..9f74a96b19aeffaaa64fb571805f3f30a7ee6b8b 100644 (file)
@@ -736,7 +736,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
       for (align = 0; align < 32; align++)
        if (grub_le_to_cpu32 (lh.kernel_alignment) & (1 << align))
          break;
-      relocatable = grub_le_to_cpu32 (lh.relocatable);
+      relocatable = lh.relocatable;
     }
   else
     {