Blame SOURCES/0262-Fix-up-linux-params-usage.patch

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