mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
mdns: Fix issue with some mDNS parsers
Some mDNS parser have issue with zero terminated TXT lists. This fix targets to overcome this issue. Found and tested with jmdns.
This commit is contained in:
parent
2016478676
commit
51dde19a76
@ -803,7 +803,7 @@ static uint16_t _mdns_append_txt_record(uint8_t * packet, uint16_t * index, mdns
|
||||
record_length += part_length;
|
||||
|
||||
uint16_t data_len_location = *index - 2;
|
||||
uint16_t data_len = 1;
|
||||
uint16_t data_len = 0;
|
||||
|
||||
char * tmp;
|
||||
mdns_txt_linked_item_t * txt = service->txt;
|
||||
@ -820,9 +820,11 @@ static uint16_t _mdns_append_txt_record(uint8_t * packet, uint16_t * index, mdns
|
||||
}
|
||||
txt = txt->next;
|
||||
}
|
||||
|
||||
packet[*index] = 0;
|
||||
*index = *index + 1;
|
||||
if (!data_len) {
|
||||
data_len = 1;
|
||||
packet[*index] = 0;
|
||||
*index = *index + 1;
|
||||
}
|
||||
_mdns_set_u16(packet, data_len_location, data_len);
|
||||
record_length += data_len;
|
||||
return record_length;
|
||||
|
Loading…
Reference in New Issue
Block a user