From 39f029558da291314b32291bd26b66891b5ade91 Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Wed, 16 Aug 2000 22:18:20 +0000 Subject: [PATCH] in dns_name_totext(), check that the target buffer is valid, and make use of the new isc_buffer_* macros --- lib/dns/name.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dns/name.c b/lib/dns/name.c index 463609dc44..192322e427 100644 --- a/lib/dns/name.c +++ b/lib/dns/name.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: name.c,v 1.101 2000/08/08 23:18:10 gson Exp $ */ +/* $Id: name.c,v 1.102 2000/08/16 22:18:20 gson Exp $ */ #include @@ -1704,12 +1704,13 @@ dns_name_totext(dns_name_t *name, isc_boolean_t omit_final_dot, * wire format. */ REQUIRE(VALID_NAME(name)); + REQUIRE(ISC_BUFFER_VALID(target)); ndata = name->ndata; nlen = name->length; labels = name->labels; - tdata = (char *)target->base + target->used; - tlen = target->length - target->used; + tdata = isc_buffer_used(target); + tlen = isc_buffer_availablelength(target); trem = tlen;