usrsock/dns: add sanity check before send dns event

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2023-06-02 14:14:01 +08:00 committed by Xiang Xiao
parent a720984eb7
commit 7c5d2a8bdd
1 changed files with 4 additions and 0 deletions

View File

@ -941,6 +941,10 @@ static int usrsock_rpmsg_send_dns_event(FAR void *arg,
uint32_t len;
dns = rpmsg_get_tx_payload_buffer(ept, &len, true);
if (dns == NULL)
{
return -ENOMEM;
}
dns->head.msgid = USRSOCK_RPMSG_DNS_EVENT;
dns->head.flags = USRSOCK_MESSAGE_FLAG_EVENT;