From: Mark Andrews Date: Thu, 26 Oct 2017 05:00:24 +0000 (+1100) Subject: 4793. [bug] nsupdate -[46] could overflow the array of server X-Git-Tag: v9.12.0b2~56 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=87387d8a41c99108ea156d8e9a0c11a73cb8a6ab;p=thirdparty%2Fbind9.git 4793. [bug] nsupdate -[46] could overflow the array of server addresses. [RT #46402] --- diff --git a/CHANGES b/CHANGES index db1c491604b..bb7b6c49572 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +4793. [bug] nsupdate -[46] could overflow the array of server + addresses. [RT #46402] + 4792. [bug] Fix map file header correctness check. [RT #38418] 4791. [doc] Fixed outdated documentation about export libraries. diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index c922cf97657..5162fb31edb 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -944,16 +944,21 @@ setup_system(void) { case AF_INET: if (have_ipv4) { sa->type.sin.sin_port = htons(dnsport); + } else { + continue; } break; case AF_INET6: if (have_ipv6) { sa->type.sin6.sin6_port = htons(dnsport); + } else { + continue; } break; default: fatal("bad family"); } + INSIST(i < ns_alloc); servers[i++] = *sa; } }