* grub-core/commands/testload.c (grub_cmd_testload): Fix overflow

if the size isn't divisible by 512.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-22 05:04:54 +01:00
parent b00d7fb6c5
commit 0ccb6b3cf0
2 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2012-02-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/commands/testload.c (grub_cmd_testload): Fix overflow
if the size isn't divisible by 512.
2012-02-22 Vladimir Serbinenko <phcoder@gmail.com>
Make list_push and list_remove functions rather than inline functions

View file

@ -100,7 +100,10 @@ grub_cmd_testload (struct grub_command *cmd __attribute__ ((unused)),
{
char sector[GRUB_DISK_SECTOR_SIZE];
pos -= GRUB_DISK_SECTOR_SIZE;
if (pos >= GRUB_DISK_SECTOR_SIZE)
pos -= GRUB_DISK_SECTOR_SIZE;
else
pos = 0;
grub_file_seek (file, pos);