summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand/installboot/installboot.c
diff options
context:
space:
mode:
authorTom Cosgrove <tom@cvs.openbsd.org>2004-01-20 23:02:27 +0000
committerTom Cosgrove <tom@cvs.openbsd.org>2004-01-20 23:02:27 +0000
commit47dd934cb84b71e78e79df9251cfc2ab126aaf22 (patch)
tree2098fcf82dbbdd849f4bd01588dc34a45b5c4dd0 /sys/arch/i386/stand/installboot/installboot.c
parent802c9b8ba826f3e560f0f1e655bdb8828cb67bf7 (diff)
Check the values given to -h and -s. Closes PR 3640.
ok weingart@, deraadt@
Diffstat (limited to 'sys/arch/i386/stand/installboot/installboot.c')
-rw-r--r--sys/arch/i386/stand/installboot/installboot.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/i386/stand/installboot/installboot.c b/sys/arch/i386/stand/installboot/installboot.c
index fa9b0e1f069..bcb58623909 100644
--- a/sys/arch/i386/stand/installboot/installboot.c
+++ b/sys/arch/i386/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.41 2003/08/25 23:27:43 tedu Exp $ */
+/* $OpenBSD: installboot.c,v 1.42 2004/01/20 23:02:26 tom Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -114,10 +114,14 @@ main(int argc, char *argv[])
switch (c) {
case 'h':
nheads = atoi(optarg);
+ if (nheads < 1 || nheads > 256)
+ errx(1, "invalid value for -h");
userspec = 1;
break;
case 's':
nsectors = atoi(optarg);
+ if (nsectors < 1 || nsectors > 63)
+ errx(1, "invalid value for -s");
userspec = 1;
break;
case 'n':