]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
3026. [bug] lib/isc/httpd.c: check that we have enough space
authorMark Andrews <marka@isc.org>
Mon, 21 Feb 2011 05:57:17 +0000 (05:57 +0000)
committerMark Andrews <marka@isc.org>
Mon, 21 Feb 2011 05:57:17 +0000 (05:57 +0000)
                        after calling grow_headerspace() and if not
                        re-call grow_headerspace() until we do. [RT #22521]

CHANGES
lib/isc/httpd.c

diff --git a/CHANGES b/CHANGES
index b42ec094501adf6c66cb875e402f183b2172a322..4074e1bba2a757ac8c2461d9c5d1a74aea788c0c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+3026.  [bug]           lib/isc/httpd.c: check that we have enough space
+                       after calling grow_headerspace() and if not
+                       re-call grow_headerspace() until we do. [RT #22521]
+
        --- 9.8.0 released ---
 
 3025.  [bug]           Fixed a possible deadlock due to zone resigning.
index 907a275dde2bcdb9c627999fed390bc1303ff036..7305a0187a3a0c558f3c9507f92ecb081f03d177 100644 (file)
@@ -14,7 +14,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: httpd.c,v 1.20 2010/11/16 05:38:31 marka Exp $ */
+/* $Id: httpd.c,v 1.20.40.1 2011/02/21 05:57:17 marka Exp $ */
 
 /*! \file */
 
@@ -821,7 +821,7 @@ isc_httpd_response(isc_httpd_t *httpd)
        needlen += 3 + 1;  /* room for response code, always 3 bytes */
        needlen += strlen(httpd->retmsg) + 2;  /* return msg + CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -846,7 +846,7 @@ isc_httpd_addheader(isc_httpd_t *httpd, const char *name,
                needlen += 2 + strlen(val); /* :<space> and val */
        needlen += 2; /* CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -869,7 +869,7 @@ isc_httpd_endheaders(isc_httpd_t *httpd)
 {
        isc_result_t result;
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);
@@ -893,7 +893,7 @@ isc_httpd_addheaderuint(isc_httpd_t *httpd, const char *name, int val) {
        needlen += 2 + strlen(buf); /* :<space> and val */
        needlen += 2; /* CRLF */
 
-       if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
+       while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
                result = grow_headerspace(httpd);
                if (result != ISC_R_SUCCESS)
                        return (result);