More tightly verify the preference returned for the new inode.

Submitted by:	Kris Kennaway <kris@obsecurity.org>
Sponsored by:   DARPA & NAI Labs.
Approved by:	re
This commit is contained in:
mckusick 2002-12-06 02:08:46 +00:00
parent 24449fa30e
commit 461d1f1c94

View File

@ -841,7 +841,7 @@ ffs_valloc(pvp, mode, cred, vpp)
ipref = ffs_dirpref(pip);
else
ipref = pip->i_number;
if (ipref >= fs->fs_ncg * fs->fs_ipg)
if ((unsigned)ipref >= fs->fs_ncg * fs->fs_ipg)
ipref = 0;
cg = ino_to_cg(fs, ipref);
/*