loader/i386: fix out of bound memory copy on non-UEFI linux

Ref: https://bugzilla.opensuse.org/show_bug.cgi?id=1029187
Ref: https://build.opensuse.org/package/rdiff/openSUSE:Factory/grub2?linkrev=base&rev=159
This commit is contained in:
Luca Bruno 2018-04-09 12:07:21 +00:00 committed by Dongsu Park
parent d3fd939f18
commit 750c71975e

View file

@ -826,7 +826,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),
len = sizeof (linux_params) - sizeof (lh);
grub_memcpy (&linux_params + sizeof (lh), kernel + kernel_offset, len);
grub_memcpy ((char *) &linux_params + sizeof (lh), kernel + kernel_offset, len);
kernel_offset += len;
linux_params.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE;