mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
2010-01-27 Vladimir Serbinenko <phcoder@gmail.com>
* kern/disk.c (grub_disk_read): Fix offset computation when reading last sectors.
This commit is contained in:
1 parent
e709ebe2ef
commit
989e1f934b
2 files changed
+7
-2
No files matched your search
+2
-2
@@ -441,7 +441,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
||||
num = ((size + GRUB_DISK_SECTOR_SIZE - 1)
|
||||
num = ((size + real_offset + pos + GRUB_DISK_SECTOR_SIZE - 1)
|
||||
>> GRUB_DISK_SECTOR_BITS);
|
||||
|
||||
p = grub_realloc (tmp_buf, num << GRUB_DISK_SECTOR_BITS);
|
||||
@@ -458,7 +458,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
|
||||
goto finish;
|
||||
}
|
||||
|
||||
grub_memcpy (buf, tmp_buf + real_offset, size);
|
||||
grub_memcpy (buf, tmp_buf + pos + real_offset, size);
|
||||
|
||||
/* Call the read hook, if any. */
|
||||
if (disk->read_hook)
|
||||
|
||||
Reference in new issue
Block a user