2002-04-30 Yoshinori K. Okuji <okuji@enbug.org>

From Jean-Jacques Michel <jjmichel@linbox.com>:
	* stage2/boot.c (load_image): For Linux, check if DATA_LEN is
	greater than MULTIBOOT_SEARCH. If that's true, read the rest
	after copying data already read in BUFFER.
This commit is contained in:
okuji 2002-04-30 14:10:03 +00:00
parent 73d5c0f09c
commit 20ac296c28
3 changed files with 20 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2002-04-30 Yoshinori K. Okuji <okuji@enbug.org>
From Jean-Jacques Michel <jjmichel@linbox.com>:
* stage2/boot.c (load_image): For Linux, check if DATA_LEN is
greater than MULTIBOOT_SEARCH. If that's true, read the rest
after copying data already read in BUFFER.
2002-04-30 Yoshinori K. Okuji <okuji@enbug.org>
* stage2/boot.c (load_image): For Linux, don't check if the

1
THANKS
View file

@ -45,6 +45,7 @@ HORIKAWA Kazunori <kaz-hori@tkd.att.ne.jp>
Jan Fricke <fricke@uni-greifswald.de>
Jan Zerebecki <jan.list@elite-pferde.de>
Jason Thomas <jason@topic.com.au>
Jean-Jacques Michel <jjmichel@linbox.com>
Jeremy Katz <katzj@redhat.com>
Jochen Hoenicke <jochen@gnu.org>
Johannes Kroeger <hanne@squirrel.owl.de>

View file

@ -352,8 +352,18 @@ load_image (char *kernel, char *arg, kernel_t suggested_type,
else
linux_mem_size = 0;
}
memmove ((char *) LINUX_SETUP, buffer, data_len + SECTOR_SIZE);
/* It is possible that DATA_LEN is greater than MULTIBOOT_SEARCH,
so the data may have been read partially. */
if (data_len <= MULTIBOOT_SEARCH)
grub_memmove ((char *) LINUX_SETUP, buffer,
data_len + SECTOR_SIZE);
else
{
grub_memmove ((char *) LINUX_SETUP, buffer, MULTIBOOT_SEARCH);
grub_read ((char *) LINUX_SETUP + MULTIBOOT_SEARCH,
data_len + SECTOR_SIZE - MULTIBOOT_SEARCH);
}
if (lh->header != LINUX_MAGIC_SIGNATURE ||
lh->version < 0x0200)