From: W.C.A. Wijngaards Date: Fri, 24 Jul 2026 12:38:46 +0000 (+0200) Subject: - Fix to guard access to shared ports interface array during X-Git-Tag: release-1.26.0rc1~6 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ca1fe4f82a7c5d8168562edc03abd455950c5dbe;p=thirdparty%2Funbound.git - Fix to guard access to shared ports interface array during set up, for analyzer. --- diff --git a/doc/Changelog b/doc/Changelog index 3ed96dcf7..6285c9ea8 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -21,6 +21,8 @@ xfer_set_masters() error path. - Fix unused variable warnings in shared_ports_fetch_random and shared_ports_return_port when compiled without threads. + - Fix to guard access to shared ports interface array during + set up, for analyzer. 23 July 2026: Wouter - Updated credits for Xuanchao Xie in 22 july changelog. diff --git a/services/outside_network.c b/services/outside_network.c index 24d8f255f..4210506fe 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -4127,13 +4127,15 @@ static int shared_ports_alloc_ifs(struct shared_ports* shp, char** ifs, size_t done_4 = 0, done_6 = 0; int i; for(i=0; inum_ip6) { if(!shared_ports_setup_if(&shp->ip6_ifs[done_6], ifs[i], availports, numavailports)) return 0; done_6++; } - if(!str_is_ip6(ifs[i]) && do_ip4) { + if(!str_is_ip6(ifs[i]) && do_ip4 && + done_4 < shp->num_ip4) { if(!shared_ports_setup_if(&shp->ip4_ifs[done_4], ifs[i], availports, numavailports)) return 0;