mdns: Fix potential read behind parsed packet

* Original commit: espressif/esp-idf@51a5de2525
This commit is contained in:
David Cermak
2022-02-02 12:21:12 +01:00
committed by suren-gabrielyan-espressif
parent 7710ea9a11
commit e5a3a3df1d
2 changed files with 48 additions and 30 deletions

View File

@ -91,6 +91,7 @@ def mdns_server(esp_host):
console_log('Received query: {} '.format(dns.__repr__()))
sock.sendto(get_dns_answer_to_mdns_lwip(TESTER_NAME_LWIP, dns.id), addr)
if len(dns.an) > 0 and dns.an[0].type == dpkt.dns.DNS_A:
console_log('Received answer from {}'.format(dns.an[0].name))
if dns.an[0].name == esp_host + u'.local':
console_log('Received answer to esp32-mdns query: {}'.format(dns.__repr__()))
esp_answered.set()