Skip to contentSkip to conversation

part_dos: check status flags of partitions

PATCH New Daniel Mack 1 participant 1 message Sep 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 part_dos: check status flags of partitions

Only read partitions which have 0x00 or 0x80 set in their status field. All others are invalid.

---
 disk/part_dos.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
disk/part_dos.c +2 -1
index 93bf3dd..e32d58e 100644
@@ -188,7 +188,8 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc, int ext_part
 		 * fdisk does not show the extended partitions that
 		 * are not in the MBR
 		 */
-		if ((pt->sys_ind != 0) &&
+		if (((pt->boot_ind & ~0x80) == 0) &&
+		    (pt->sys_ind != 0) &&
 		    (part_num == which_part) &&
 		    (is_extended(pt->sys_ind) == 0)) {
 			info->blksz = 512;
Signature · 1 line
1.6.3.3