From 6e24566186c52dc5432b6b25c81abda577c21e85 Mon Sep 17 00:00:00 2001 From: Siarhei Volkau Date: Fri, 27 Oct 2017 10:22:01 +0300 Subject: [PATCH] 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. --- components/mdns/mdns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 40b4c7096..c77283e07 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -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;