From 86d08fdb18b0142c1ce1b95db1aae989502956c5 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 19 Sep 2012 02:44:54 +0100 Subject: [PATCH] * 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. --- ChangeLog | 6 ++++++ grub-core/partmap/msdos.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ab401d6e..5db804e2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-09-19 Colin Watson + + * 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 * util/grub-setup.c (write_rootdev): Remove unused core_img diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c index 6e54a7427..10ca3f08b 100644 --- a/grub-core/partmap/msdos.c +++ b/grub-core/partmap/msdos.c @@ -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;