* grub-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one

error.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-02-12 09:59:04 +03:00
parent fee7cdd4e1
commit d998657dcf
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2011-02-12 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one
error.
2011-02-11 Colin Watson <cjwatson@ubuntu.com>
* util/grub.d/20_linux_xen.in: Bail out early if linux_list is

View File

@ -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;