]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4793. [bug] nsupdate -[46] could overflow the array of server
authorMark Andrews <marka@isc.org>
Thu, 26 Oct 2017 05:00:24 +0000 (16:00 +1100)
committerMark Andrews <marka@isc.org>
Thu, 26 Oct 2017 05:00:24 +0000 (16:00 +1100)
                        addresses. [RT #46402]

CHANGES
bin/nsupdate/nsupdate.c

diff --git a/CHANGES b/CHANGES
index db1c491604b23d38899e05629737f3d2ab40eeca..bb7b6c49572fefecba21b334d2900e1e1d429bc6 100644 (file)
--- 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.
index c922cf97657858fdae441693c46c68c2fb3cb4ad..5162fb31edbb6d38c55e49be1110f64cc75e9b17 100644 (file)
@@ -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;
                }
        }