+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
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>
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)