From c03400184411aae122f413bb99f3ddef6631639c Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 22 Dec 2011 07:43:51 +0000 Subject: [PATCH] 3253. [bug] Return DNS_R_SYNTAX when the input to a text field is too long. [RT #26956] --- CHANGES | 3 +++ lib/dns/rdata.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 0f3f485954..9135893965 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3253. [bug] Return DNS_R_SYNTAX when the input to a text field is + too long. [RT #26956] + 3251. [bug] Enforce a upper bound (65535 bytes) on the amount of memory dns_sdlz_putrr() can allocate per record to prevent run away memory consumption on ISC_R_NOSPACE. diff --git a/lib/dns/rdata.c b/lib/dns/rdata.c index b929bd344f..7aad5c2a72 100644 --- a/lib/dns/rdata.c +++ b/lib/dns/rdata.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rdata.c,v 1.209.8.3 2011/11/02 01:10:14 marka Exp $ */ +/* $Id: rdata.c,v 1.209.8.4 2011/12/22 07:43:51 marka Exp $ */ /*! \file */ @@ -1123,7 +1123,8 @@ txt_fromtext(isc_textregion_t *source, isc_buffer_t *target) { } escape = ISC_FALSE; if (nrem == 0) - return (ISC_R_NOSPACE); + return ((tregion.length <= 256U) ? + ISC_R_NOSPACE : DNS_R_SYNTAX); *t++ = c; nrem--; }