mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'bugfix/mdns_invalid_hostname_queries' into 'master'
mdns: fix crash for hostname queries See merge request espressif/esp-idf!6480
This commit is contained in:
commit
e461668ea6
@ -445,6 +445,10 @@ static uint16_t _mdns_append_ptr_record(uint8_t * packet, uint16_t * index, cons
|
|||||||
uint16_t record_length = 0;
|
uint16_t record_length = 0;
|
||||||
uint8_t part_length;
|
uint8_t part_length;
|
||||||
|
|
||||||
|
if (service == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
str[0] = instance;
|
str[0] = instance;
|
||||||
str[1] = service;
|
str[1] = service;
|
||||||
str[2] = proto;
|
str[2] = proto;
|
||||||
@ -489,6 +493,10 @@ static uint16_t _mdns_append_sdptr_record(uint8_t * packet, uint16_t * index, md
|
|||||||
uint16_t record_length = 0;
|
uint16_t record_length = 0;
|
||||||
uint8_t part_length;
|
uint8_t part_length;
|
||||||
|
|
||||||
|
if (service == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
sd_str[0] = (char*)"_services";
|
sd_str[0] = (char*)"_services";
|
||||||
sd_str[1] = (char*)"_dns-sd";
|
sd_str[1] = (char*)"_dns-sd";
|
||||||
sd_str[2] = (char*)"_udp";
|
sd_str[2] = (char*)"_udp";
|
||||||
@ -534,6 +542,10 @@ static uint16_t _mdns_append_txt_record(uint8_t * packet, uint16_t * index, mdns
|
|||||||
uint16_t record_length = 0;
|
uint16_t record_length = 0;
|
||||||
uint8_t part_length;
|
uint8_t part_length;
|
||||||
|
|
||||||
|
if (service == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
str[0] = _mdns_get_service_instance_name(service);
|
str[0] = _mdns_get_service_instance_name(service);
|
||||||
str[1] = service->service;
|
str[1] = service->service;
|
||||||
str[2] = service->proto;
|
str[2] = service->proto;
|
||||||
@ -602,6 +614,10 @@ static uint16_t _mdns_append_srv_record(uint8_t * packet, uint16_t * index, mdns
|
|||||||
uint16_t record_length = 0;
|
uint16_t record_length = 0;
|
||||||
uint8_t part_length;
|
uint8_t part_length;
|
||||||
|
|
||||||
|
if (service == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
str[0] = _mdns_get_service_instance_name(service);
|
str[0] = _mdns_get_service_instance_name(service);
|
||||||
str[1] = service->service;
|
str[1] = service->service;
|
||||||
str[2] = service->proto;
|
str[2] = service->proto;
|
||||||
@ -1151,6 +1167,7 @@ static bool _mdns_alloc_answer(mdns_out_answer_t ** destnation, uint16_t type, m
|
|||||||
}
|
}
|
||||||
a->type = type;
|
a->type = type;
|
||||||
a->service = service;
|
a->service = service;
|
||||||
|
a->custom_service = NULL;
|
||||||
a->bye = bye;
|
a->bye = bye;
|
||||||
a->flush = flush;
|
a->flush = flush;
|
||||||
a->next = NULL;
|
a->next = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user