Fix an integer overflow that causes fsck_ffs to crash when it

encounters very large file sizes in the filesystem.

Reviewed by:	mckusick
This commit is contained in:
iedowse 2002-06-26 16:40:25 +00:00
parent 614440e53d
commit 5b8bc2e87b

View File

@ -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,