dhserver: Fix a potential DoS vulnerability accidentially introduced by #1712

This commit is contained in:
Jannis Achstetter 2023-02-04 22:37:39 +01:00
parent 4c03a9f855
commit 830849211d
No known key found for this signature in database
GPG Key ID: 79895EC26DFB95B8
1 changed files with 6 additions and 2 deletions

View File

@ -242,7 +242,11 @@ static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const
memcpy(&dhcp_data, p->payload, n);
ptr = find_dhcp_option(dhcp_data.dp_options, sizeof(dhcp_data.dp_options), DHCP_MESSAGETYPE);
if (ptr == NULL) return;
if (ptr == NULL)
{
pbuf_free(p);
return;
}
switch (ptr[2])
{