]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2010-02-03 Torsten Landschoff <torsten@debian.org>
authorTorsten Landschoff <torsten@debian.org>
Tue, 2 Feb 2010 23:46:55 +0000 (00:46 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 2 Feb 2010 23:46:55 +0000 (00:46 +0100)
* kern/disk.c (grub_disk_read): Fix offset computation when reading
last sectors.

ChangeLog
kern/disk.c

index 83d0c58a87614e357d55707aa4b80b1ba0e10345..d7ae963dd1804c63da2f49ba88bed2b80ab63bdf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-02-03  Torsten Landschoff   <torsten@debian.org>
+
+       * kern/disk.c (grub_disk_read): Fix offset computation when reading
+       last sectors.
+
 2010-02-03  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * disk/i386/pc/biosdisk.c (grub_biosdisk_read): Handle non-2048 aligned
index a01373072baf3d297722b217da6722743c29ce27..5c30e1727fa605be0ef95a3e9cf45cf711229d6a 100644 (file)
@@ -441,7 +441,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
 
              grub_errno = GRUB_ERR_NONE;
 
-             num = ((size + real_offset + pos + GRUB_DISK_SECTOR_SIZE - 1)
+             num = ((size + real_offset + 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 + pos + real_offset, size);
+             grub_memcpy (buf, tmp_buf + real_offset, size);
 
              /* Call the read hook, if any.  */
              if (disk->read_hook)