Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: rpmsgdrv.c: prevent potential danger #190

Merged
merged 1 commit into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions drivers/net/rpmsgdrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,13 @@ static int net_rpmsg_drv_ept_cb(FAR struct rpmsg_endpoint *ept, void *data,
FAR struct net_rpmsg_header_s *header = data;
uint32_t command = header->command;

#ifdef CONFIG_MPFS_IHC_CLIENT
if (command != NET_RPMSG_TRANSFER)
{
return -EINVAL;
}
#endif

if (command < sizeof(g_net_rpmsg_drv_handler) /
sizeof(g_net_rpmsg_drv_handler[0]))
{
Expand Down
Loading