mirror of
https://github.com/apache/nuttx.git
synced 2026-09-02 07:03:04 +00:00
usrsock_server: coverity fix for access invalid index
req->usockid maybe < 0 or > CONFIG_NET_USRSOCK_RPMSG_SERVER_NSOCKS, if so , priv->pfds[req->usockid] will access invalid memory. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
parent
0ead147841
commit
dd080773cc
1 changed files with 1 additions and 1 deletions
|
|
@ -494,7 +494,7 @@ out:
|
|||
}
|
||||
|
||||
retr = usrsock_rpmsg_send_ack(ept, events, req->head.xid, ret);
|
||||
if (retr >= 0 && events == 0)
|
||||
if (retr >= 0 && (ret > 0 || ret == -EAGAIN) && events == 0)
|
||||
{
|
||||
usrsock_rpmsg_poll_setup(&priv->pfds[req->usockid],
|
||||
priv->pfds[req->usockid].events | POLLOUT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue