fs/nfs/nfs_vfsops.c: Fix buffer corruption. In case multiple read requests to the NFS server are required to fill up the user provided buffer, nfs_read might write behind the end of said buffer. This is fixed with this change.

This commit is contained in:
Michael Jung
2017-12-28 06:31:49 -06:00
committed by Gregory Nutt
parent 66f632c3a3
commit d46a7beef9
+1 -1
View File
@@ -834,7 +834,7 @@ static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen)
{
/* Make sure that the attempted read size does not exceed the RPC maximum */
readsize = buflen;
readsize = buflen - bytesread;
if (readsize > nmp->nm_rsize)
{
readsize = nmp->nm_rsize;