Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > a0ef309aba3a78d3350b149f382e72aa > files > 80

bind-9.3.6-25.P1.el5_11.12.src.rpm

diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c
index 702c306..1d7d098 100644
--- a/lib/dns/resolver.c
+++ b/lib/dns/resolver.c
@@ -5903,15 +5903,19 @@ answer_response(fetchctx_t *fctx) {
 						 * a CNAME or DNAME).
 						 */
 						INSIST(!external);
-						if ((rdataset->type !=
-						     dns_rdatatype_cname) ||
-						    !found_dname ||
-						    (aflag ==
-						     DNS_RDATASETATTR_ANSWER))
+						/*
+						 * Don't use found_cname here
+						 * as we have just set it
+						 * above.
+						 */
+						if (cname == NULL &&
+						    !found_dname &&
+						    aflag ==
+						     DNS_RDATASETATTR_ANSWER)
 						{
 							have_answer = ISC_TRUE;
-							if (rdataset->type ==
-							    dns_rdatatype_cname)
+							if (found_cname &&
+							    cname == NULL)
 								cname = name;
 							name->attributes |=
 								DNS_NAMEATTR_ANSWER;