diff --git a/ChangeLog b/ChangeLog index 6e9ab5758..3a695b25a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-02-12 Vladimir Serbinenko + + * grub-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one + error. + 2011-02-11 Colin Watson * util/grub.d/20_linux_xen.in: Bail out early if linux_list is diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c index d411c4405..31a0a0707 100644 --- a/grub-core/partmap/msdos.c +++ b/grub-core/partmap/msdos.c @@ -232,10 +232,10 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors, break; } - if (end >= *nsectors + 1) + if (end >= *nsectors + 2) { unsigned i; - *nsectors = end - 1; + *nsectors = end - 2; *sectors = grub_malloc (*nsectors * sizeof (**sectors)); if (!*sectors) return grub_errno;