[syslinux] [PATCH 1/4] chain.c: mismatch between index and mbr_index in mbr iterator

Michal Soltys soltys at ziu.info
Mon Jul 26 15:50:32 PDT 2010


When primary partitions are iterated, non-data partitions should also
be counted. For example, if we have data partitions #1, #2, #4 and
empty partition #3, then chain.c32 hd0 4 would fail. This patch
fixes this.

Signed-off-by: Michal Soltys <soltys at ziu.info>
---
 com32/modules/chain.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index 48a83d2..91db9f7 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -624,8 +624,8 @@ static struct disk_part_iter *next_mbr_part(struct disk_part_iter *part)
 
     /* Update parameters to reflect this new partition.  Re-use iterator */
     part->lba_data = table[part->private.mbr_index].start_lba;
-    dprintf("Partition %d primary lba %u\n", part->index, part->lba_data);
-    part->index++;
+    dprintf("Partition %d primary lba %u\n", part->private.mbr_index, part->lba_data);
+    part->index = part->private.mbr_index + 1;
     part->record = table + part->private.mbr_index;
     return part;
 
-- 
1.6.3.1




More information about the Syslinux mailing list