Check the filehandle size when mounting.

Obtained from:  Constantine Sapuntzakis <csapuntz@openbsd.org>
This commit is contained in:
peter 2001-07-30 20:01:59 +00:00
parent f1723cd9ea
commit 4763bc528e
2 changed files with 4 additions and 0 deletions

View File

@ -804,6 +804,8 @@ nfs_mount(mp, path, data, ndp, p)
nfs_decode_args(nmp, &args);
return (0);
}
if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX)
return (EINVAL);
error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
if (error)
return (error);

View File

@ -804,6 +804,8 @@ nfs_mount(mp, path, data, ndp, p)
nfs_decode_args(nmp, &args);
return (0);
}
if (args.fhsize < 0 || args.fhsize > NFSX_V3FHMAX)
return (EINVAL);
error = copyin((caddr_t)args.fh, (caddr_t)nfh, args.fhsize);
if (error)
return (error);