From 8569ab045a4cf6ecd1b5a3354ddb1c93ef34ea57 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Mon, 21 Jan 2002 16:26:06 +0000 Subject: [PATCH] 1182. [bug] The server could throw an assertion failure when constructing a negative response packet. --- CHANGES | 3 +++ lib/dns/ncache.c | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index e48116f64d..afeed962e8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +1182. [bug] The server could throw an assertion failure when + constructing a negative response packet. + 1181. [func] Add the "key-directory" configuration statement, which allows the server to look for online signing keys in alternate directories. diff --git a/lib/dns/ncache.c b/lib/dns/ncache.c index 083f15c7b7..c641cedeaa 100644 --- a/lib/dns/ncache.c +++ b/lib/dns/ncache.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ncache.c,v 1.25 2001/11/30 01:59:13 gson Exp $ */ +/* $Id: ncache.c,v 1.26 2002/01/21 16:26:06 bwelling Exp $ */ #include @@ -258,7 +258,7 @@ dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx, { dns_rdata_t rdata = DNS_RDATA_INIT; isc_result_t result; - isc_region_t remaining, tremaining; + isc_region_t remaining, tavailable; isc_buffer_t source, savedbuffer, rdlen; dns_name_t name; dns_rdatatype_t type; @@ -324,8 +324,8 @@ dns_ncache_towire(dns_rdataset_t *rdataset, dns_compress_t *cctx, * See if we have space for type, class, ttl, and * rdata length. Write the type, class, and ttl. */ - isc_buffer_remainingregion(target, &tremaining); - if (tremaining.length < 10) { + isc_buffer_availableregion(target, &tavailable); + if (tavailable.length < 10) { result = ISC_R_NOSPACE; goto rollback; }