diff --git a/ChangeLog b/ChangeLog index 3fd3d2ec9..d8c75dfab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-01 Vladimir Serbinenko + + * commands/loadenv.c (check_blocklists): Fix off-by-one error. + (write_blocklists): Likewise. + 2009-09-01 Colin Watson * script/lua/grub_lua.h (fputs): Supply a format string as the first diff --git a/commands/loadenv.c b/commands/loadenv.c index 22665f9fe..c60eb835c 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -242,7 +242,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, part_start = 0; buf = grub_envblk_buffer (envblk); - for (p = blocklists, index = 0; p; p = p->next, index += p->length) + for (p = blocklists, index = 0; p; index += p->length, p = p->next) { char blockbuf[GRUB_DISK_SECTOR_SIZE]; @@ -278,7 +278,7 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, part_start = 0; index = 0; - for (p = blocklists; p; p = p->next, index += p->length) + for (p = blocklists; p; index += p->length, p = p->next) { if (grub_disk_write (disk, p->sector - part_start, p->offset, p->length, buf + index))