mdns: add bound check when setting interface as duplicate

Closes IDF-2787

Partially addresses https://github.com/espressif/esp-idf/issues/6440
This commit is contained in:
suren.gabrielyan 2021-02-12 13:18:59 +04:00 committed by bot
parent b8e6d8e699
commit 2b9d2c06f5

View File

@ -2202,6 +2202,9 @@ static void _mdns_dup_interface(mdns_if_t tcpip_if)
{
uint8_t i;
mdns_if_t other_if = _mdns_get_other_if (tcpip_if);
if (other_if == MDNS_IF_MAX) {
return; // no other interface found
}
for (i=0; i<MDNS_IP_PROTOCOL_MAX; i++) {
if (_mdns_server->interfaces[other_if].pcbs[i].pcb) {
//stop this interface and mark as dup