summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorweingart <weingart@openbsd.org>1997-10-12 19:39:48 +0000
committerweingart <weingart@openbsd.org>1997-10-12 19:39:48 +0000
commit15e9ecd18b21044220eeecca6f8402cb3f7b521f (patch)
treedd2320a71d0f056a8328fbe15c2097e0aee9ac72
parentproper libraries (diff)
downloadwireguard-openbsd-15e9ecd18b21044220eeecca6f8402cb3f7b521f.tar.xz
wireguard-openbsd-15e9ecd18b21044220eeecca6f8402cb3f7b521f.zip
One more sanity check. If no blocks to load,
complain bitterly.
-rw-r--r--sys/arch/i386/stand/installboot/installboot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/arch/i386/stand/installboot/installboot.c b/sys/arch/i386/stand/installboot/installboot.c
index db4cf96bccc..b496d6f5394 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.18 1997/10/07 08:56:18 mickey Exp $ */
+/* $OpenBSD: installboot.c,v 1.19 1997/10/12 19:39:48 weingart Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -425,6 +425,8 @@ loadblocknums(boot, devfd, dl)
* Have the inode. Figure out how many blocks we need.
*/
ndb = howmany(ip->di_size, fs->fs_bsize);
+ if (ndb <= 0)
+ errx(1, "No blocks to load");
if (ndb > maxblocknum)
errx(1, "Too many blocks");
if (verbose)