b8119d9
From 6b2eba692ce88288202c826e70d30164b7d7f606 Mon Sep 17 00:00:00 2001
bc092b9
From: Peter Jones <pjones@redhat.com>
bc092b9
Date: Tue, 30 May 2017 14:16:07 -0400
bbc6a89
Subject: [PATCH 168/192] Fix up linux params usage...
bc092b9
bc092b9
Signed-off-by: Peter Jones <pjones@redhat.com>
bc092b9
---
bc092b9
 grub-core/loader/i386/linux.c | 5 ++++-
bc092b9
 1 file changed, 4 insertions(+), 1 deletion(-)
bc092b9
bc092b9
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
bc092b9
index e4b8342f5..c9e89310b 100644
bc092b9
--- a/grub-core/loader/i386/linux.c
bc092b9
+++ b/grub-core/loader/i386/linux.c
bc092b9
@@ -680,6 +680,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
bc092b9
 {
bc092b9
   grub_file_t file = 0;
bc092b9
   struct linux_kernel_header lh;
bc092b9
+  grub_uint8_t *linux_params_ptr;
bc092b9
   grub_uint8_t setup_sects;
bc092b9
   grub_size_t real_size, prot_size, prot_file_size, kernel_offset;
bc092b9
   grub_ssize_t len;
bc092b9
@@ -811,6 +812,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
bc092b9
 		      preferred_address))
bc092b9
     goto fail;
bc092b9
 
bc092b9
+
bc092b9
   grub_memset (&linux_params, 0, sizeof (linux_params));
bc092b9
   grub_memcpy (&linux_params.setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1);
bc092b9
 
bc092b9
@@ -820,7 +822,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
bc092b9
 
bc092b9
   len = sizeof (linux_params) - sizeof (lh);
bc092b9
 
bc092b9
-  grub_memcpy (&linux_params + sizeof (lh), kernel + kernel_offset, len);
bc092b9
+  linux_params_ptr = (void *)&linux_params;
bc092b9
+  grub_memcpy (linux_params_ptr + sizeof (lh), kernel + kernel_offset, len);
bc092b9
   kernel_offset += len;
bc092b9
 
bc092b9
   linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;
bc092b9
-- 
bbc6a89
2.13.4
bc092b9