* grub-core/partmap/msdos.c (pc_partition_map_embed): Revert

incorrect off-by-one fix from 2011-02-12.  A 62-sector core image
should fit before end == 63.
This commit is contained in:
Colin Watson 2012-09-19 02:44:54 +01:00
parent 735abf545c
commit 86d08fdb18
2 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2012-09-19 Colin Watson <cjwatson@ubuntu.com>
* grub-core/partmap/msdos.c (pc_partition_map_embed): Revert
incorrect off-by-one fix from 2011-02-12. A 62-sector core image
should fit before end == 63.
2012-09-19 Colin Watson <cjwatson@ubuntu.com>
* util/grub-setup.c (write_rootdev): Remove unused core_img

View File

@ -316,14 +316,14 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
break;
}
if (end >= *nsectors + 2)
if (end >= *nsectors + 1)
{
unsigned i, j;
char *embed_signature_check;
unsigned int orig_nsectors, avail_nsectors;
orig_nsectors = *nsectors;
*nsectors = end - 2;
*nsectors = end - 1;
avail_nsectors = *nsectors;
if (*nsectors > max_nsectors)
*nsectors = max_nsectors;