mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-07-16 20:12:13 +02:00
mdns: Fix crashes reported by the fuzzer tests
* Original commit: espressif/esp-idf@4a2e72677c
This commit is contained in:
committed by
suren-gabrielyan-espressif
parent
5f6b6f9273
commit
40da0d29be
@ -3171,9 +3171,9 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
|||||||
if (discovery) {
|
if (discovery) {
|
||||||
service = _mdns_get_service_item(name->service, name->proto, NULL);
|
service = _mdns_get_service_item(name->service, name->proto, NULL);
|
||||||
_mdns_remove_parsed_question(parsed_packet, MDNS_TYPE_SDPTR, service);
|
_mdns_remove_parsed_question(parsed_packet, MDNS_TYPE_SDPTR, service);
|
||||||
} else if (parsed_packet->questions && !parsed_packet->probe) {
|
} else if (service && parsed_packet->questions && !parsed_packet->probe) {
|
||||||
_mdns_remove_parsed_question(parsed_packet, type, service);
|
_mdns_remove_parsed_question(parsed_packet, type, service);
|
||||||
} else {
|
} else if (service) {
|
||||||
//check if TTL is more than half of the full TTL value (4500)
|
//check if TTL is more than half of the full TTL value (4500)
|
||||||
if (ttl > 2250) {
|
if (ttl > 2250) {
|
||||||
_mdns_remove_scheduled_answer(packet->tcpip_if, packet->ip_protocol, type, service);
|
_mdns_remove_scheduled_answer(packet->tcpip_if, packet->ip_protocol, type, service);
|
||||||
@ -3262,7 +3262,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
|||||||
}
|
}
|
||||||
_mdns_restart_all_pcbs();
|
_mdns_restart_all_pcbs();
|
||||||
}
|
}
|
||||||
} else {
|
} else if (service) {
|
||||||
_mdns_pcb_send_bye(packet->tcpip_if, packet->ip_protocol, &service, 1, false);
|
_mdns_pcb_send_bye(packet->tcpip_if, packet->ip_protocol, &service, 1, false);
|
||||||
_mdns_init_pcb_probe(packet->tcpip_if, packet->ip_protocol, &service, 1, false);
|
_mdns_init_pcb_probe(packet->tcpip_if, packet->ip_protocol, &service, 1, false);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user