]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
prevent null socket dereference in IPv6 interface address adjustment
authorTatuya JINMEI 神明達哉 <jinmei@isc.org>
Thu, 26 Jun 2008 22:18:18 +0000 (22:18 +0000)
committerTatuya JINMEI 神明達哉 <jinmei@isc.org>
Thu, 26 Jun 2008 22:18:18 +0000 (22:18 +0000)
[RT #18203]

lib/dns/dispatch.c

index 3019aa045d7e977207c2c72687ae39fcb03966d6..f2f6911c253b2a241dc45361f6b6665f5753bbb5 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: dispatch.c,v 1.116.18.23 2008/06/24 23:45:55 tbox Exp $ */
+/* $Id: dispatch.c,v 1.116.18.24 2008/06/26 22:18:18 jinmei Exp $ */
 
 /*! \file */
 
@@ -2002,18 +2002,17 @@ local_addr_match(dns_dispatch_t *disp, isc_sockaddr_t *addr) {
        isc_sockaddr_t sockaddr;
        isc_result_t result;
 
+       REQUIRE(disp->socket != NULL);
+
        if (addr == NULL)
                return (ISC_TRUE);
 
        /*
         * Don't match wildcard ports unless the port is available in the
-        * current configuration.  We can skip this check when disp->socket is
-        * NULL because such a dispatcher will choose ports on-demand from
-        * the available set.
+        * current configuration.
         */
        if (isc_sockaddr_getport(addr) == 0 &&
            isc_sockaddr_getport(&disp->local) == 0 &&
-           disp->socket != NULL &&
            !portavailable(disp->mgr, disp->socket, NULL)) {
                return (ISC_FALSE);
        }
@@ -2058,10 +2057,10 @@ dispatch_find(dns_dispatchmgr_t *mgr, isc_sockaddr_t *local,
        isc_result_t result;
 
        /*
-        * Make certain that we will not match a private dispatch.
+        * Make certain that we will not match a private or exclusive dispatch.
         */
-       attributes &= ~DNS_DISPATCHATTR_PRIVATE;
-       mask |= DNS_DISPATCHATTR_PRIVATE;
+       attributes &= ~(DNS_DISPATCHATTR_PRIVATE|DNS_DISPATCHATTR_EXCLUSIVE);
+       mask |= (DNS_DISPATCHATTR_PRIVATE|DNS_DISPATCHATTR_EXCLUSIVE);
 
        disp = ISC_LIST_HEAD(mgr->list);
        while (disp != NULL) {