summaryrefslogtreecommitdiffstats
path: root/sbin/fsck_ffs/pass1.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2002-06-26 16:40:25 +0000
committeriedowse <iedowse@FreeBSD.org>2002-06-26 16:40:25 +0000
commit5b8bc2e87b7f8d8e1821c975e9cafbf1820ba8df (patch)
tree1f392fbf22b7768b0b10b12ba00d52c5338d92e9 /sbin/fsck_ffs/pass1.c
parent614440e53d44acce999382a2a966be14f0e990aa (diff)
downloadFreeBSD-src-5b8bc2e87b7f8d8e1821c975e9cafbf1820ba8df.zip
FreeBSD-src-5b8bc2e87b7f8d8e1821c975e9cafbf1820ba8df.tar.gz
Fix an integer overflow that causes fsck_ffs to crash when it
encounters very large file sizes in the filesystem. Reviewed by: mckusick
Diffstat (limited to 'sbin/fsck_ffs/pass1.c')
-rw-r--r--sbin/fsck_ffs/pass1.c2
1 files changed, 1 insertions, 1 deletions
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,
OpenPOWER on IntegriCloud