diff options
author | Tobias Weingartner <weingart@cvs.openbsd.org> | 1997-10-12 19:39:49 +0000 |
---|---|---|
committer | Tobias Weingartner <weingart@cvs.openbsd.org> | 1997-10-12 19:39:49 +0000 |
commit | 41c2bd0f81acf2566cd8e7e7d6951f48e3a3ae39 (patch) | |
tree | f79d0c34c2511e5da3d4eaac40fa211884cbe09d /sys | |
parent | 1eb197bc784a0d950b2d9f1757c29693bd2fd453 (diff) |
One more sanity check. If no blocks to load,
complain bitterly.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/stand/installboot/installboot.c | 4 |
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) |