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

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