Module Name:    src
Committed By:   christos
Date:           Wed Nov 16 17:28:10 UTC 2011

Modified Files:
        src/external/bsd/bind/dist/bin/named: query.c
        src/external/bsd/bind/dist/lib/dns: rbtdb.c

Log Message:
patch for: https://www.isc.org/software/bind/advisories/cve-2011-tbd


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/bsd/bind/dist/bin/named/query.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/bind/dist/lib/dns/rbtdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/bind/dist/bin/named/query.c
diff -u src/external/bsd/bind/dist/bin/named/query.c:1.6 src/external/bsd/bind/dist/bin/named/query.c:1.7
--- src/external/bsd/bind/dist/bin/named/query.c:1.6	Sun Sep 11 14:55:27 2011
+++ src/external/bsd/bind/dist/bin/named/query.c	Wed Nov 16 12:28:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.6 2011/09/11 18:55:27 christos Exp $	*/
+/*	$NetBSD: query.c,v 1.7 2011/11/16 17:28:10 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2011  Internet Systems Consortium, Inc. ("ISC")
@@ -1395,11 +1395,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			/*
-			 * Negative cache entries don't have sigrdatasets.
-			 */
-			INSIST(sigrdataset == NULL ||
-			       ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL &&
+			    dns_rdataset_isassociated(sigrdataset))
+				dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1440,8 +1438,9 @@ query_addadditional(void *arg, dns_name_
 			goto addname;
 		if (result == DNS_R_NCACHENXRRSET) {
 			dns_rdataset_disassociate(rdataset);
-			INSIST(sigrdataset == NULL ||
-			       ! dns_rdataset_isassociated(sigrdataset));
+			if (sigrdataset != NULL &&
+			    dns_rdataset_isassociated(sigrdataset))
+				dns_rdataset_disassociate(sigrdataset);
 		}
 		if (result == ISC_R_SUCCESS) {
 			mname = NULL;
@@ -1891,10 +1890,8 @@ query_addadditional2(void *arg, dns_name
 		goto setcache;
 	if (result == DNS_R_NCACHENXRRSET) {
 		dns_rdataset_disassociate(rdataset);
-		/*
-		 * Negative cache entries don't have sigrdatasets.
-		 */
-		INSIST(! dns_rdataset_isassociated(sigrdataset));
+		if (dns_rdataset_isassociated(sigrdataset))
+			dns_rdataset_disassociate(sigrdataset);
 	}
 	if (result == ISC_R_SUCCESS) {
 		/* Remember the result as a cache */

Index: src/external/bsd/bind/dist/lib/dns/rbtdb.c
diff -u src/external/bsd/bind/dist/lib/dns/rbtdb.c:1.10 src/external/bsd/bind/dist/lib/dns/rbtdb.c:1.11
--- src/external/bsd/bind/dist/lib/dns/rbtdb.c:1.10	Sun Sep 11 14:55:36 2011
+++ src/external/bsd/bind/dist/lib/dns/rbtdb.c	Wed Nov 16 12:28:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbtdb.c,v 1.10 2011/09/11 18:55:36 christos Exp $	*/
+/*	$NetBSD: rbtdb.c,v 1.11 2011/11/16 17:28:10 christos Exp $	*/
 
 /*
  * Copyright (C) 2004-2011  Internet Systems Consortium, Inc. ("ISC")
@@ -5055,7 +5055,7 @@ cache_find(dns_db_t *db, dns_name_t *nam
 			      rdataset);
 		if (need_headerupdate(found, search.now))
 			update = found;
-		if (foundsig != NULL) {
+		if (!NEGATIVE(found) && foundsig != NULL) {
 			bind_rdataset(search.rbtdb, node, foundsig, search.now,
 				      sigrdataset);
 			if (need_headerupdate(foundsig, search.now))
@@ -5687,7 +5687,7 @@ cache_findrdataset(dns_db_t *db, dns_dbn
 	}
 	if (found != NULL) {
 		bind_rdataset(rbtdb, rbtnode, found, now, rdataset);
-		if (foundsig != NULL)
+		if (!NEGATIVE(found) && foundsig != NULL)
 			bind_rdataset(rbtdb, rbtnode, foundsig, now,
 				      sigrdataset);
 	}

Reply via email to