Blame SOURCES/0044-grub-core-partmap-msdos.c-pc_partition_map_embed-Rev.patch

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