sntp_send_request: assert that argument 'server_addr' != NULL

This commit is contained in:
goldsimon 2017-12-17 22:13:09 +01:00
parent ba270c2414
commit 82483073f0

View File

@ -532,6 +532,9 @@ static void
sntp_send_request(const ip_addr_t *server_addr) sntp_send_request(const ip_addr_t *server_addr)
{ {
struct pbuf *p; struct pbuf *p;
LWIP_ASSERT("server_addr != NULL", server_addr != NULL);
p = pbuf_alloc(PBUF_TRANSPORT, SNTP_MSG_LEN, PBUF_RAM); p = pbuf_alloc(PBUF_TRANSPORT, SNTP_MSG_LEN, PBUF_RAM);
if (p != NULL) { if (p != NULL) {
struct sntp_msg *sntpmsg = (struct sntp_msg *)p->payload; struct sntp_msg *sntpmsg = (struct sntp_msg *)p->payload;