NFS: readdir shouldn't read beyond the reply returned by the server

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Trond Myklebust
2010-11-15 20:26:22 -05:00
parent 8cd51a0ccd
commit ac39612824
5 changed files with 11 additions and 7 deletions

View File

@ -555,7 +555,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
struct page **page;
size_t hdrlen;
u32 recvd, pglen;
int status, nr = 0;
int status;
status = ntohl(*p++);
/* Decode post_op_attrs */
@ -586,7 +586,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res
pglen = recvd;
page = rcvbuf->pages;
return nr;
return pglen;
}
__be32 *