Skip to content
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
17 changes: 15 additions & 2 deletions arch/arm/src/nrf91/nrf91_modem_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1111,16 +1111,29 @@ static int nrf91_usrsock_ioctl_handler(struct nrf91_usrsock_s *usrsock,
{
const struct usrsock_request_ioctl_s *req = data;
struct usrsock_message_datareq_ack_s *ack = NULL;
size_t copylen;
int ret = 0;

if (len < sizeof(*req))
{
return -EINVAL;
}

ack = (struct usrsock_message_datareq_ack_s *)usrsock->out;
memcpy(ack + 1, req + 1, req->arglen);
copylen = req->arglen;
if (copylen > len - sizeof(*req) ||
copylen > sizeof(usrsock->out) - sizeof(*ack))
{
return -EINVAL;
}

memcpy(ack + 1, req + 1, copylen);
ret = nrf91_usrsock_ioctl(req->usockid,
req->cmd,
(unsigned long)(ack + 1));

return nrf91_usrsock_send_dack(usrsock, ack, req->head.xid, ret,
req->arglen, req->arglen);
copylen, copylen);
}

/****************************************************************************
Expand Down
Loading