diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index c4fdd2a8a578..59a7a84c7d94 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -242,6 +242,8 @@ pass2check(struct inodesc *idesc) /* * check for "." */ + if (dirp->d_ino > maxino) + goto chk2; if (idesc->id_entryno != 0) goto chk1; if (dirp->d_ino != 0 && strcmp(dirp->d_name, ".") == 0) {