From ed7f35a9f73f9895be856d7861fe9752cb52e3b7 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Tue, 2 Mar 1999 19:55:17 +0000 Subject: [PATCH] compact() didn't recompute the offsets table even though offsets might have changed. As soon as a bitstring that didn't need compaction was encountered, compact() would stop instead of processing the entire string. --- lib/dns/name.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/dns/name.c b/lib/dns/name.c index a1048da4a3..2b996948bb 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -1550,7 +1550,7 @@ compact(dns_name_t *name, unsigned char *offsets) { n--; curr = &name->ndata[offsets[n]]; if (curr[0] != DNS_LABELTYPE_BITSTRING) - break; + continue; /* * We have consecutive bitstrings labels, and * the more significant label ('head') has @@ -1657,6 +1657,11 @@ compact(dns_name_t *name, unsigned char *offsets) { while (head != last) *curr++ = *head++; name->length = (curr - name->ndata); + /* + * The offsets table may now be invalid. + */ + set_offsets(name, offsets, ISC_FALSE, + ISC_FALSE, ISC_FALSE); goto again; } } @@ -2058,7 +2063,6 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name, unsigned int nrem; unsigned int labels; unsigned int count; - isc_boolean_t absolute = ISC_FALSE; dns_name_t tmp_name; REQUIRE(VALID_NAME(prefix));