summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_disk.c4
-rw-r--r--sys/sys/disklabel.h5
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index d3e7431af92..b9bc9a91d83 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.115 2011/03/14 17:20:00 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.116 2011/03/17 21:44:10 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -400,7 +400,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *),
* Read dos partition table, follow extended partitions.
* Map the partitions to disklabel entries i-p
*/
- while (wander && loop < 8) {
+ while (wander && loop < DOS_MAXEBR) {
loop++;
wander = 0;
if (part_blkno < extoff)
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index 159e16ac4ec..78e7739bea1 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.48 2010/04/25 06:15:16 deraadt Exp $ */
+/* $OpenBSD: disklabel.h,v 1.49 2011/03/17 21:44:10 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.41 1996/05/10 23:07:37 mark Exp $ */
/*
@@ -403,6 +403,9 @@ struct partinfo {
#define DOSMBR_SIGNATURE (0xaa55)
#define DOSMBR_SIGNATURE_OFF (0x1fe)
+/* Maximum number of Extended Boot Records (EBRs) to traverse. */
+#define DOS_MAXEBR 8
+
struct dos_partition {
u_int8_t dp_flag; /* bootstrap flags */
u_int8_t dp_shd; /* starting head */