+2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/kern/disk.c (grub_disk_read): Fix hook calling for
+ unaligned segments.
+
2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Add ieee1275/
while (l)
{
- (disk->read_hook) (s, o,
- ((l > GRUB_DISK_SECTOR_SIZE)
- ? GRUB_DISK_SECTOR_SIZE
- : l));
+ grub_size_t cl;
+ cl = GRUB_DISK_SECTOR_SIZE - o;
+ if (cl > l)
+ cl = l;
+ (disk->read_hook) (s, o, cl);
s++;
- l -= GRUB_DISK_SECTOR_SIZE - o;
+ l -= cl;
o = 0;
}
}