summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1997-06-22 20:10:49 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1997-06-22 20:10:49 +0000
commit80ecbf94418e357f589bf7366b80f8c7b605793b (patch)
treedb16b201b797d26ea5b942c64db72d80db730812 /sbin
parentd23f4916cdd3a76bfd8a069d05516d9592291be4 (diff)
Avoid an overflow when checking inode numbers; from FreeBSD PR #3528 by
Ian Dowse <iedowse@maths.tcd.ie>
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/inode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fsck_ffs/inode.c b/sbin/fsck_ffs/inode.c
index 8c5c051116b..52c428b9fe2 100644
--- a/sbin/fsck_ffs/inode.c
+++ b/sbin/fsck_ffs/inode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inode.c,v 1.8 1996/10/20 08:36:34 tholo Exp $ */
+/* $OpenBSD: inode.c,v 1.9 1997/06/22 20:10:48 tholo Exp $ */
/* $NetBSD: inode.c,v 1.23 1996/10/11 20:15:47 thorpej Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)inode.c 8.5 (Berkeley) 2/8/95";
#else
-static char rcsid[] = "$OpenBSD: inode.c,v 1.8 1996/10/20 08:36:34 tholo Exp $";
+static char rcsid[] = "$OpenBSD: inode.c,v 1.9 1997/06/22 20:10:48 tholo Exp $";
#endif
#endif /* not lint */
@@ -246,7 +246,7 @@ chkrange(blk, cnt)
{
register int c;
- if ((unsigned)(blk + cnt) > maxfsblock)
+ if ((unsigned)blk > maxfsblock || (unsigned)(blk + cnt) > maxfsblock)
return (1);
c = dtog(&sblock, blk);
if (blk < cgdmin(&sblock, c)) {