mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
mdns: Fix potential null dereference identified by fuzzer tests
This commit is contained in:
parent
71fc5fa478
commit
e7dabb14f7
@ -2775,7 +2775,8 @@ static bool _mdns_question_matches(mdns_parsed_question_t * question, uint16_t t
|
|||||||
}
|
}
|
||||||
} else if (service && (type == MDNS_TYPE_SRV || type == MDNS_TYPE_TXT)) {
|
} else if (service && (type == MDNS_TYPE_SRV || type == MDNS_TYPE_TXT)) {
|
||||||
const char * name = _mdns_get_service_instance_name(service->service);
|
const char * name = _mdns_get_service_instance_name(service->service);
|
||||||
if (name && question->host && !strcasecmp(name, question->host)
|
if (name && question->host && question->service && question->proto && question->domain
|
||||||
|
&& !strcasecmp(name, question->host)
|
||||||
&& !strcasecmp(service->service->service, question->service)
|
&& !strcasecmp(service->service->service, question->service)
|
||||||
&& !strcasecmp(service->service->proto, question->proto)
|
&& !strcasecmp(service->service->proto, question->proto)
|
||||||
&& !strcasecmp(MDNS_DEFAULT_DOMAIN, question->domain)) {
|
&& !strcasecmp(MDNS_DEFAULT_DOMAIN, question->domain)) {
|
||||||
@ -3237,7 +3238,7 @@ void mdns_parse_packet(mdns_rx_packet_t * packet)
|
|||||||
} else if (service) { // only detect srv collision if service existed
|
} else if (service) { // only detect srv collision if service existed
|
||||||
col = _mdns_check_srv_collision(service->service, priority, weight, port, name->host, name->domain);
|
col = _mdns_check_srv_collision(service->service, priority, weight, port, name->host, name->domain);
|
||||||
}
|
}
|
||||||
if (col && (parsed_packet->probe || parsed_packet->authoritative)) {
|
if (service && col && (parsed_packet->probe || parsed_packet->authoritative)) {
|
||||||
if (col > 0 || !port) {
|
if (col > 0 || !port) {
|
||||||
do_not_reply = true;
|
do_not_reply = true;
|
||||||
if (_mdns_server->interfaces[packet->tcpip_if].pcbs[packet->ip_protocol].probe_running) {
|
if (_mdns_server->interfaces[packet->tcpip_if].pcbs[packet->ip_protocol].probe_running) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user