summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/boot/i386/boot2/boot2.c5
-rw-r--r--sys/boot/i386/gptboot/gptboot.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/boot/i386/boot2/boot2.c b/sys/boot/i386/boot2/boot2.c
index ddd0316..cc20a92 100644
--- a/sys/boot/i386/boot2/boot2.c
+++ b/sys/boot/i386/boot2/boot2.c
@@ -14,7 +14,7 @@
*/
/*
- * $Id: boot2.c,v 1.18 1999/01/11 11:36:03 rnordier Exp $
+ * $Id: boot2.c,v 1.19 1999/01/24 00:10:10 msmith Exp $
*/
#include <sys/param.h>
@@ -571,7 +571,8 @@ dskread(void *buf, unsigned lba, unsigned nblk)
dsk.type = MAJ_DA;
dsk.init++;
}
- if (dsk.part >= d->d_npartitions) {
+ if (dsk.part >= d->d_npartitions ||
+ !d->d_partitions[dsk.part].p_size) {
printf("Invalid %s\n", "partition");
return -1;
}
diff --git a/sys/boot/i386/gptboot/gptboot.c b/sys/boot/i386/gptboot/gptboot.c
index ddd0316..cc20a92 100644
--- a/sys/boot/i386/gptboot/gptboot.c
+++ b/sys/boot/i386/gptboot/gptboot.c
@@ -14,7 +14,7 @@
*/
/*
- * $Id: boot2.c,v 1.18 1999/01/11 11:36:03 rnordier Exp $
+ * $Id: boot2.c,v 1.19 1999/01/24 00:10:10 msmith Exp $
*/
#include <sys/param.h>
@@ -571,7 +571,8 @@ dskread(void *buf, unsigned lba, unsigned nblk)
dsk.type = MAJ_DA;
dsk.init++;
}
- if (dsk.part >= d->d_npartitions) {
+ if (dsk.part >= d->d_npartitions ||
+ !d->d_partitions[dsk.part].p_size) {
printf("Invalid %s\n", "partition");
return -1;
}
OpenPOWER on IntegriCloud