a5bd9f6
From fbc6f5faf45f489125f98a11f3593cd43b4d6b76 Mon Sep 17 00:00:00 2001
a5bd9f6
From: Colin Watson <cjwatson@ubuntu.com>
a5bd9f6
Date: Wed, 19 Sep 2012 02:44:54 +0100
a5bd9f6
Subject: [PATCH 044/364] * grub-core/partmap/msdos.c (pc_partition_map_embed):
a5bd9f6
 Revert incorrect off-by-one fix from 2011-02-12.  A 62-sector core image
a5bd9f6
 should fit before end == 63.
a5bd9f6
a5bd9f6
---
a5bd9f6
 ChangeLog                 | 6 ++++++
a5bd9f6
 grub-core/partmap/msdos.c | 4 ++--
a5bd9f6
 2 files changed, 8 insertions(+), 2 deletions(-)
a5bd9f6
a5bd9f6
diff --git a/ChangeLog b/ChangeLog
a5bd9f6
index 1ab401d..5db804e 100644
a5bd9f6
--- a/ChangeLog
a5bd9f6
+++ b/ChangeLog
a5bd9f6
@@ -1,5 +1,11 @@
a5bd9f6
 2012-09-19  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
 
a5bd9f6
+	* grub-core/partmap/msdos.c (pc_partition_map_embed): Revert
a5bd9f6
+	incorrect off-by-one fix from 2011-02-12.  A 62-sector core image
a5bd9f6
+	should fit before end == 63.
a5bd9f6
+
a5bd9f6
+2012-09-19  Colin Watson  <cjwatson@ubuntu.com>
a5bd9f6
+
a5bd9f6
 	* util/grub-setup.c (write_rootdev): Remove unused core_img
a5bd9f6
 	parameter.  Update all callers.
a5bd9f6
 	(setup): Define core_sectors only if GRUB_SETUP_BIOS, to appease
a5bd9f6
diff --git a/grub-core/partmap/msdos.c b/grub-core/partmap/msdos.c
a5bd9f6
index 6e54a74..10ca3f0 100644
a5bd9f6
--- a/grub-core/partmap/msdos.c
a5bd9f6
+++ b/grub-core/partmap/msdos.c
a5bd9f6
@@ -316,14 +316,14 @@ pc_partition_map_embed (struct grub_disk *disk, unsigned int *nsectors,
a5bd9f6
 	break;
a5bd9f6
     }
a5bd9f6
 
a5bd9f6
-  if (end >= *nsectors + 2)
a5bd9f6
+  if (end >= *nsectors + 1)
a5bd9f6
     {
a5bd9f6
       unsigned i, j;
a5bd9f6
       char *embed_signature_check;
a5bd9f6
       unsigned int orig_nsectors, avail_nsectors;
a5bd9f6
 
a5bd9f6
       orig_nsectors = *nsectors;
a5bd9f6
-      *nsectors = end - 2;
a5bd9f6
+      *nsectors = end - 1;
a5bd9f6
       avail_nsectors = *nsectors;
a5bd9f6
       if (*nsectors > max_nsectors)
a5bd9f6
 	*nsectors = max_nsectors;
a5bd9f6
-- 
a5bd9f6
1.8.1.4
a5bd9f6