]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3251. [bug] Enforce a upper bound (65535 bytes) on the amount of
authorMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 07:18:45 +0000 (07:18 +0000)
committerMark Andrews <marka@isc.org>
Thu, 22 Dec 2011 07:18:45 +0000 (07:18 +0000)
                        memory dns_sdlz_putrr() can allocate per record to
                        prevent run away memory consumption on ISC_R_NOSPACE.
                        [RT #26956]

CHANGES
lib/dns/sdlz.c

diff --git a/CHANGES b/CHANGES
index f5f386ec4a0728aff3341c51129b33f465c46f1e..cecc6013b3b33dc500a81be372ae310c2a9ad952 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+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.
+                       [RT #26956]
+
 3250.  [func]          'configure --enable-developer'; turn on various
                        configure options, normally off by default, that
                        we want developers to build and test with. [RT #27103]
index 82ebc5f6ccda407255099c378efa2305bb9aaf54..3871a7c46706b412317fb21ce126424ac75a613d 100644 (file)
@@ -50,7 +50,7 @@
  * USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: sdlz.c,v 1.18.50.8 2011/03/12 04:57:27 tbox Exp $ */
+/* $Id: sdlz.c,v 1.18.50.9 2011/12/22 07:18:45 marka Exp $ */
 
 /*! \file */
 
@@ -1569,7 +1569,11 @@ dns_sdlz_putrr(dns_sdlzlookup_t *lookup, const char *type, dns_ttl_t ttl,
                                            &lookup->callbacks);
                if (result != ISC_R_SUCCESS)
                        isc_buffer_free(&rdatabuf);
+               if (size >= 65535)
+                       break;
                size *= 2;
+               if (size >= 65535)
+                       size = 65535;
        } while (result == ISC_R_NOSPACE);
 
        if (result != ISC_R_SUCCESS)