mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
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:
committed by
Gregory Nutt
parent
66f632c3a3
commit
d46a7beef9
+1
-1
@@ -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 */
|
/* Make sure that the attempted read size does not exceed the RPC maximum */
|
||||||
|
|
||||||
readsize = buflen;
|
readsize = buflen - bytesread;
|
||||||
if (readsize > nmp->nm_rsize)
|
if (readsize > nmp->nm_rsize)
|
||||||
{
|
{
|
||||||
readsize = nmp->nm_rsize;
|
readsize = nmp->nm_rsize;
|
||||||
|
|||||||
Reference in New Issue
Block a user