Commit 78a21ca0 authored by Trond Myklebust's avatar Trond Myklebust

NFSv3: Fix an XDR overflow bug in READDIRPLUS

parent b14d09be
...@@ -536,16 +536,16 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) ...@@ -536,16 +536,16 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res)
if (res->plus) { if (res->plus) {
/* post_op_attr */ /* post_op_attr */
if (p > end) if (p + 2 > end)
goto short_pkt; goto short_pkt;
if (*p++) { if (*p++) {
p += 21; p += 21;
if (p > end) if (p + 1 > end)
goto short_pkt; goto short_pkt;
} }
/* post_op_fh3 */ /* post_op_fh3 */
if (*p++) { if (*p++) {
if (p > end) if (p + 1 > end)
goto short_pkt; goto short_pkt;
len = ntohl(*p++); len = ntohl(*p++);
if (len > NFS3_FHSIZE) { if (len > NFS3_FHSIZE) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment