summaryrefslogtreecommitdiff
path: root/fs/nfs/mount_clnt.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-19 23:21:11 +0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-06-24 01:09:06 +0400
commitb7e2445737ff69cef892b6fd9cd71cae2c9e9515 (patch)
treed248fa5765d8e4b6ab00f10a77f9cbe793644672 /fs/nfs/mount_clnt.c
parent33852a1f2bb014e4047a844556c0d76a2f790c37 (diff)
downloadlinux-b7e2445737ff69cef892b6fd9cd71cae2c9e9515.tar.xz
NFS: Fix filehandle size comparisons in the mount code
Fix a sign issue in xdr_decode_fhstatus3() Fix incorrect comparison in nfs_validate_mount_data() Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/mount_clnt.c')
-rw-r--r--fs/nfs/mount_clnt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c
index 49c7cd0502cc..779d2eb649c5 100644
--- a/fs/nfs/mount_clnt.c
+++ b/fs/nfs/mount_clnt.c
@@ -130,10 +130,11 @@ static int xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p,
struct mnt_fhstatus *res)
{
struct nfs_fh *fh = res->fh;
+ unsigned size;
if ((res->status = ntohl(*p++)) == 0) {
- int size = ntohl(*p++);
- if (size <= NFS3_FHSIZE) {
+ size = ntohl(*p++);
+ if (size <= NFS3_FHSIZE && size != 0) {
fh->size = size;
memcpy(fh->data, p, size);
} else