summaryrefslogtreecommitdiff
path: root/sbin/fsck_ffs/pass5.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2010-07-09 06:41:18 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2010-07-09 06:41:18 +0000
commita5370692eb5c5cb505a07728e9db949afee333a2 (patch)
tree560d50bc1051a13097b60ac7f3e3dd5808e95dde /sbin/fsck_ffs/pass5.c
parent9a512965e37dba75c50e179799690b04a037bffe (diff)
Avoid crashes by using correct types for block numbers, which can grow
large on very large filesystems; reported by Benny Lofgren; partly from FreeBSD. ok deraadt@ beck@ millert@
Diffstat (limited to 'sbin/fsck_ffs/pass5.c')
-rw-r--r--sbin/fsck_ffs/pass5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index 9823e6518a8..6db07feb217 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pass5.c,v 1.38 2009/10/27 23:59:32 deraadt Exp $ */
+/* $OpenBSD: pass5.c,v 1.39 2010/07/09 06:41:17 otto Exp $ */
/* $NetBSD: pass5.c,v 1.16 1996/09/27 22:45:18 christos Exp $ */
/*
@@ -170,9 +170,9 @@ pass5(void)
idesc[i].id_fix = FIX;
}
memset(&cstotal, 0, sizeof(struct csum_total));
- j = blknum(fs, fs->fs_size + fs->fs_frag - 1);
- for (i = fs->fs_size; i < j; i++)
- setbmap(i);
+ dmax = blknum(fs, fs->fs_size + fs->fs_frag - 1);
+ for (d = fs->fs_size; d < dmax; d++)
+ setbmap(d);
info_cg = 0;
info_maxcg = fs->fs_ncg;
info_fn = pass5_info;