Add a sanity check for a negative args.fhsize to the experimental

NFS client.

MFC after:	5 days
This commit is contained in:
Rick Macklem 2010-05-17 23:55:38 +00:00
parent 4d84f49da4
commit 5ed9b96420
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=208234

View File

@ -951,7 +951,7 @@ nfs_mount(struct mount *mp)
if (vfs_getopt(mp->mnt_optnew, "fh", (void **)&args.fh,
&args.fhsize) == 0) {
if (args.fhsize > NFSX_FHMAX) {
if (args.fhsize < 0 || args.fhsize > NFSX_FHMAX) {
vfs_mount_error(mp, "Bad file handle");
error = EINVAL;
goto out;