components/mdns: wrong Message compression detect

Old behavior assumes message compressed when any of 2 most significant bits are set,
But in fact Message compressed only when both those bits are set to 1.

Also maximal label length should be 63 bytes.


* Original commit: espressif/esp-idf@6e24566186
This commit is contained in:
Siarhei Volkau
2017-10-27 10:22:01 +03:00
committed by suren-gabrielyan-espressif
parent 907e7ee29e
commit 00a72b8920

View File

@ -555,9 +555,9 @@ static const uint8_t * _mdns_read_fqdn(const uint8_t * packet, const uint8_t * s
return NULL;
}
uint8_t len = start[index++];
if ((len & 0xC0) == 0) {
if (len > 64) {
//length can not be more than 64
if (len < 0xC0) {
if (len > 63) {
//length can not be more than 63
return NULL;
}
uint8_t i;