From 09ce08a85f59bbc4bd3a8dee94f0b105cbec787e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Mon, 18 Feb 2019 12:57:35 +1100 Subject: [PATCH] fix the use of dns_wildcardname as an optimisation in DLZ (cherry picked from commit cb32cd98bda3a7e57ad098eeda128c3a2ffcc95e) --- lib/dns/sdlz.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/dns/sdlz.c b/lib/dns/sdlz.c index 7c311329ef2..9468101ae0e 100644 --- a/lib/dns/sdlz.c +++ b/lib/dns/sdlz.c @@ -621,17 +621,20 @@ getnodedata(dns_db_t *db, dns_name_t *name, bool create, dns_name_t *wild; dns_fixedname_init(&fixed); - if (i == dlabels) + if (i == dlabels - 1) { wild = dns_wildcardname; - else { - wild = dns_fixedname_name(&fixed); + } else { + dns_name_t *fname; + fname = dns_fixedname_name(&fixed); dns_name_getlabelsequence(name, i + 1, dlabels - i - 1, - wild); + fname); result = dns_name_concatenate(dns_wildcardname, - wild, wild, NULL); + fname, fname, + NULL); if (result != ISC_R_SUCCESS) return (result); + wild = fname; } isc_buffer_init(&b, wildstr, sizeof(wildstr)); -- 2.47.3