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