From 41c2bd0f81acf2566cd8e7e7d6951f48e3a3ae39 Mon Sep 17 00:00:00 2001 From: Tobias Weingartner Date: Sun, 12 Oct 1997 19:39:49 +0000 Subject: One more sanity check. If no blocks to load, complain bitterly. --- sys/arch/i386/stand/installboot/installboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sys') 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) -- cgit v1.2.3