summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-30 14:46:40 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-30 14:46:40 +0200
commit34b9656f0b2890743eee6a746ef08d817abfd5e9 (patch)
treee3770a379328701c4f2162b02a1b154c99e3b044
parent0ec7c46eed06269edf80121ec53f1eba2e2870d4 (diff)
resolved: fix cname handling
-rw-r--r--src/resolve/resolved-dns-question.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/resolve/resolved-dns-question.c b/src/resolve/resolved-dns-question.c
index 66017e82cd..45bcbbf23a 100644
--- a/src/resolve/resolved-dns-question.c
+++ b/src/resolve/resolved-dns-question.c
@@ -115,7 +115,7 @@ int dns_question_matches_cname(DnsQuestion *q, DnsResourceRecord *rr) {
return r;
}
- return 1;
+ return 0;
}
int dns_question_is_valid(DnsQuestion *q) {
@@ -137,6 +137,8 @@ int dns_question_is_valid(DnsQuestion *q) {
/* Check that all keys in this question bear the same name */
for (i = 1; i < q->n_keys; i++) {
+ assert(q->keys[i]);
+
r = dns_name_equal(DNS_RESOURCE_KEY_NAME(q->keys[i]), name);
if (r <= 0)
return r;
@@ -218,7 +220,7 @@ int dns_question_cname_redirect(DnsQuestion *q, const char *name, DnsQuestion **
return -ENOMEM;
/* Create a new question, and patch in the new name */
- for (n->n_keys = 0; n->n_keys < q->n_keys; n->n_keys++) {
+ for (i = 0; i < q->n_keys; i++) {
_cleanup_(dns_resource_key_unrefp) DnsResourceKey *k = NULL;
k = dns_resource_key_new(q->keys[i]->class, q->keys[i]->type, name);