From 5b8bc2e87b7f8d8e1821c975e9cafbf1820ba8df Mon Sep 17 00:00:00 2001 From: iedowse Date: Wed, 26 Jun 2002 16:40:25 +0000 Subject: Fix an integer overflow that causes fsck_ffs to crash when it encounters very large file sizes in the filesystem. Reviewed by: mckusick --- sbin/fsck_ffs/pass1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sbin/fsck_ffs/pass1.c') diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 10f03eb..6562155 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -276,7 +276,7 @@ checkinode(ino_t inumber, struct inodesc *idesc) } } } - for (j = ndb; j < NDADDR; j++) + for (j = ndb; ndb < NDADDR && j < NDADDR; j++) if (DIP(dp, di_db[j]) != 0) { if (debug) printf("bad direct addr[%d]: %qu\n", j, -- cgit v1.1