Be conservative and do not try to consume more bytes than was

requested from the server for the read operation.  Server shall not
reply with too large size, but client should be resilent too.

Reviewed by:	rmacklem
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2013-01-27 09:34:25 +00:00
parent 5f451cd59b
commit 6168020f66
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=245977

View File

@ -1444,7 +1444,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *uiop, struct ucred *cred,
NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED);
eof = fxdr_unsigned(int, *tl);
}
NFSM_STRSIZ(retlen, rsize);
NFSM_STRSIZ(retlen, len);
error = nfsm_mbufuio(nd, uiop, retlen);
if (error)
goto nfsmout;