From 8cb03d24071322908ab06ca0e906791bbcd5cefd Mon Sep 17 00:00:00 2001 From: "suren.gabrielyan" Date: Fri, 12 Feb 2021 13:18:59 +0400 Subject: [PATCH] mdns: add bound check when setting interface as duplicate Closes IDF-2787 Partially addresses https://github.com/espressif/esp-idf/issues/6440 * Original commit: espressif/esp-idf@2b9d2c06f54924b680c41ae641978c8d81612f65 --- components/mdns/mdns.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 8bb30eed283..35cbe2293ee 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -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; iinterfaces[other_if].pcbs[i].pcb) { //stop this interface and mark as dup