]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix question section mismatch in local zone redirect.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Jul 2019 12:01:59 +0000 (14:01 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Tue, 23 Jul 2019 12:01:59 +0000 (14:01 +0200)
doc/Changelog
services/mesh.c

index 75d1a900ac92566d712032b17e873df094e65268..089c4de652aee5fcf7ad3106c54ebdf33ec4ee43 100644 (file)
@@ -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.
index 59ee9a08ec0e93f20e2d64443c0550cfd6878b39..0d7118af996c0e2d6adbc1d3baf4f1d1893c64b2 100644 (file)
@@ -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. */