Commit 108300f7 authored by Mark Andrews's avatar Mark Andrews

2883. [bug] 'dig +short' failed to handle really large datasets.

                        [RT #21113]
parent 74cfabb9
2883. [bug] 'dig +short' failed to handle really large datasets.
[RT #21113]
2882. [bug] Remove memory context from list of active contexts
before clearing 'magic'. [RT #21274]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.c,v 1.235 2010/03/04 23:50:34 tbox Exp $ */
/* $Id: dig.c,v 1.236 2010/05/12 01:31:37 marka Exp $ */
/*! \file */
......@@ -311,6 +311,8 @@ say_message(dns_rdata_t *rdata, dig_query_t *query, isc_buffer_t *buf) {
ADD_STRING(buf, " ");
}
result = dns_rdata_totext(rdata, NULL, buf);
if (result == ISC_R_NOSPACE)
return (result);
check_result(result, "dns_rdata_totext");
if (query->lookup->identify) {
TIME_NOW(&now);
......@@ -333,10 +335,8 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
{
dns_name_t *name;
dns_rdataset_t *rdataset;
isc_buffer_t target;
isc_result_t result, loopresult;
dns_name_t empty_name;
char t[4096];
dns_rdata_t rdata = DNS_RDATA_INIT;
UNUSED(flags);
......@@ -352,8 +352,6 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
name = NULL;
dns_message_currentname(msg, DNS_SECTION_ANSWER, &name);
isc_buffer_init(&target, t, sizeof(t));
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
......@@ -362,6 +360,8 @@ short_answer(dns_message_t *msg, dns_messagetextflag_t flags,
dns_rdataset_current(rdataset, &rdata);
result = say_message(&rdata, query,
buf);
if (result == ISC_R_NOSPACE)
return (result);
check_result(result, "say_message");
loopresult = dns_rdataset_next(rdataset);
dns_rdata_reset(&rdata);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment