diff --git a/CHANGES b/CHANGES index db1c491604..bb7b6c4957 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 c922cf9765..5162fb31ed 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; } }