diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-07-29 17:45:21 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2002-07-29 17:45:21 +0000 |
commit | f34b0c32e1c30ec9659a03009994b75fd113201e (patch) | |
tree | 2088ea311f5af4fc00ed4336e9b10f3e0250be91 | |
parent | 1cbf083622825cb0aaa98dcae4dad738a37b77e4 (diff) |
Fix two off-by-one errors when sanity-checking inode numbers. In
ext2fs, inode numbers start at 1, so the maximum valid inode number
is (s_inodes_per_group * s_groups_count), not one less.
From FreeBSD.
costa@ ok.
-rw-r--r-- | sys/ufs/ext2fs/ext2fs_vfsops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c index 642acd632f9..79c61f88022 100644 --- a/sys/ufs/ext2fs/ext2fs_vfsops.c +++ b/sys/ufs/ext2fs/ext2fs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_vfsops.c,v 1.24 2002/07/28 21:22:27 fgsch Exp $ */ +/* $OpenBSD: ext2fs_vfsops.c,v 1.25 2002/07/29 17:45:20 fgsch Exp $ */ /* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */ /* @@ -956,7 +956,7 @@ ext2fs_fhtovp(mp, fhp, vpp) ufhp = (struct ufid *)fhp; fs = VFSTOUFS(mp)->um_e2fs; if ((ufhp->ufid_ino < EXT2_FIRSTINO && ufhp->ufid_ino != EXT2_ROOTINO) || - ufhp->ufid_ino >= fs->e2fs_ncg * fs->e2fs.e2fs_ipg) + ufhp->ufid_ino > fs->e2fs_ncg * fs->e2fs.e2fs_ipg) return (ESTALE); if ((error = VFS_VGET(mp, ufhp->ufid_ino, &nvp)) != 0) { |