From: W.C.A. Wijngaards Date: Tue, 23 Jul 2019 12:01:59 +0000 (+0200) Subject: - Fix question section mismatch in local zone redirect. X-Git-Tag: release-1.9.3rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f5c00203e87d5c7cd1152476edb8fc9778d0be3;p=thirdparty%2Funbound.git - Fix question section mismatch in local zone redirect. --- diff --git a/doc/Changelog b/doc/Changelog index 75d1a900a..089c4de65 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +23 July 2019: Wouter + - Fix question section mismatch in local zone redirect. + 19 July 2019: Wouter - Fix #49: Set no renegotiation on the SSL context to stop client session renegotiation. diff --git a/services/mesh.c b/services/mesh.c index 59ee9a08e..0d7118af9 100644 --- a/services/mesh.c +++ b/services/mesh.c @@ -1340,14 +1340,15 @@ int mesh_state_add_reply(struct mesh_state* s, struct edns_data* edns, log_assert(!qinfo->local_alias->next && dsrc->count == 1 && qinfo->local_alias->rrset->rk.type == htons(LDNS_RR_TYPE_CNAME)); - /* Technically, we should make a local copy for the owner - * name of the RRset, but in the case of the first (and - * currently only) local alias RRset, the owner name should - * point to the qname of the corresponding query, which should - * be valid throughout the lifetime of this mesh_reply. So - * we can skip copying. */ - log_assert(qinfo->local_alias->rrset->rk.dname == - sldns_buffer_at(rep->c->buffer, LDNS_HEADER_SIZE)); + /* we should make a local copy for the owner name of + * the RRset */ + r->local_alias->rrset->rk.dname_len = + qinfo->local_alias->rrset->rk.dname_len; + r->local_alias->rrset->rk.dname = regional_alloc_init( + s->s.region, qinfo->local_alias->rrset->rk.dname, + qinfo->local_alias->rrset->rk.dname_len); + if(!r->local_alias->rrset->rk.dname) + return 0; /* the rrset is not packed, like in the cache, but it is * individualy allocated with an allocator from localzone. */