From 187bf10eb566d407d54e66b42b468c6c33f2591c Mon Sep 17 00:00:00 2001 From: Andreas Gustafsson Date: Mon, 27 Aug 2001 21:31:29 +0000 Subject: [PATCH] eliminated arbitrary limit on formatted rdata size in 'host' [RT #1557] --- bin/dig/host.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/dig/host.c b/bin/dig/host.c index 809ca97d0d..a2a1a330bd 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: host.c,v 1.75 2001/08/01 16:18:56 bwelling Exp $ */ +/* $Id: host.c,v 1.76 2001/08/27 21:31:29 gson Exp $ */ #include #include @@ -260,11 +260,18 @@ say_message(dns_name_t *name, const char *msg, dns_rdata_t *rdata, char namestr[DNS_NAME_FORMATSIZE]; isc_region_t r; isc_result_t result; + unsigned int bufsize = BUFSIZ; - result = isc_buffer_allocate(mctx, &b, OUTPUTBUF); - check_result(result, "isc_buffer_allocate"); dns_name_format(name, namestr, sizeof(namestr)); + retry: + result = isc_buffer_allocate(mctx, &b, bufsize); + check_result(result, "isc_buffer_allocate"); result = dns_rdata_totext(rdata, NULL, b); + if (result == ISC_R_NOSPACE) { + isc_buffer_free(&b); + bufsize *= 2; + goto retry; + } check_result(result, "dns_rdata_totext"); isc_buffer_usedregion(b, &r); if (query->lookup->identify_previous_line) {