mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-25 16:27:29 +02:00
mdns: Fix case where service is NULL and that will cause exception
* Original commit: espressif/esp-idf@4fa130ae4f
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
ef924f1aa5
commit
bce7d5231c
@ -1304,6 +1304,10 @@ static mdns_tx_packet_t * _mdns_get_next_pcb_packet(tcpip_adapter_if_t tcpip_if,
|
|||||||
*/
|
*/
|
||||||
static void _mdns_remove_scheduled_answer(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, uint16_t type, mdns_srv_item_t * service)
|
static void _mdns_remove_scheduled_answer(tcpip_adapter_if_t tcpip_if, mdns_ip_protocol_t ip_protocol, uint16_t type, mdns_srv_item_t * service)
|
||||||
{
|
{
|
||||||
|
mdns_srv_item_t s = {NULL, NULL};
|
||||||
|
if (!service) {
|
||||||
|
service = &s;
|
||||||
|
}
|
||||||
mdns_tx_packet_t * q = _mdns_server->tx_queue_head;
|
mdns_tx_packet_t * q = _mdns_server->tx_queue_head;
|
||||||
while (q) {
|
while (q) {
|
||||||
if (q->tcpip_if == tcpip_if && q->ip_protocol == ip_protocol && q->distributed) {
|
if (q->tcpip_if == tcpip_if && q->ip_protocol == ip_protocol && q->distributed) {
|
||||||
@ -1336,6 +1340,10 @@ static void _mdns_dealloc_answer(mdns_out_answer_t ** destnation, uint16_t type,
|
|||||||
if (!d) {
|
if (!d) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mdns_srv_item_t s = {NULL, NULL};
|
||||||
|
if (!service) {
|
||||||
|
service = &s;
|
||||||
|
}
|
||||||
if (d->type == type && d->service == service->service) {
|
if (d->type == type && d->service == service->service) {
|
||||||
*destnation = d->next;
|
*destnation = d->next;
|
||||||
free(d);
|
free(d);
|
||||||
|
Reference in New Issue
Block a user