Skip to content

Commit

Permalink
NFSv4.1: decode_getdeviceinfo should check xdr_read_pages() return value
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 26, 2012
1 parent 8a9a8b8 commit 13fe4ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -5642,7 +5642,8 @@ static int decode_getdeviceinfo(struct xdr_stream *xdr,
* and places the remaining xdr data in xdr_buf->tail
*/
pdev->mincount = be32_to_cpup(p);
xdr_read_pages(xdr, pdev->mincount); /* include space for the length */
if (xdr_read_pages(xdr, pdev->mincount) != pdev->mincount)
goto out_overflow;

/* Parse notification bitmap, verifying that it is zero. */
p = xdr_inline_decode(xdr, 4);
Expand Down

0 comments on commit 13fe4ba

Please sign in to comment.