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:
parent
81e7b13a05
commit
ee6e62c3ce
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue