From: Tianjia Zhang Date: Mon, 11 Jan 2021 03:04:36 +0000 (+0800) Subject: loader/i386/linux: Do not use grub_le_to_cpu32() for relocatable variable X-Git-Tag: grub-2.06-rc1~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fcfd1e0fc72d58766ce3dc09cf883c032f063f6;p=thirdparty%2Fgrub.git loader/i386/linux: Do not use grub_le_to_cpu32() for relocatable variable 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 Reviewed-by: Daniel Kiper --- diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c index 0eea64a20..9f74a96b1 100644 --- a/grub-core/loader/i386/linux.c +++ b/grub-core/loader/i386/linux.c @@ -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 {