* grub-core/partmap/msdos.c (pc_partition_map_embed): Fix off by one
error.
This commit is contained in:
parent
fee7cdd4e1
commit
d998657dcf
2 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue