mirror of
https://github.com/apache/nuttx.git
synced 2026-09-21 13:25:12 +08:00
drivers/misc: fix rpmsgdev read overflow
the msg count is not changed while iov len is increased. which may cause the buffer reply by server is bigger than msg count Signed-off-by: rongyichang <rongyichang@xiaomi.com>
This commit is contained in:
@@ -420,7 +420,7 @@ static ssize_t rpmsgdev_read(FAR struct file *filep, FAR char *buffer,
|
||||
{
|
||||
ret = rpmsgdev_send_recv(dev, command, true, &msg.header,
|
||||
sizeof(msg) - 1, &read);
|
||||
if (ret != -EAGAIN || priv->nonblock)
|
||||
if (ret != -EAGAIN || read.iov_len > 0 || priv->nonblock)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user