2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 13:38:26 +00:00

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]
This commit is contained in:
Mark Andrews 2011-02-21 05:55:09 +00:00
parent e06bc030b3
commit 17a0bbda33
2 changed files with 9 additions and 5 deletions

View File

@ -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]
3025. [bug] Fixed a possible deadlock due to zone resigning. 3025. [bug] Fixed a possible deadlock due to zone resigning.
[RT #22964] [RT #22964]

View File

@ -14,7 +14,7 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: httpd.c,v 1.20 2010/11/16 05:38:31 marka Exp $ */ /* $Id: httpd.c,v 1.21 2011/02/21 05:55:09 marka Exp $ */
/*! \file */ /*! \file */
@ -821,7 +821,7 @@ isc_httpd_response(isc_httpd_t *httpd)
needlen += 3 + 1; /* room for response code, always 3 bytes */ needlen += 3 + 1; /* room for response code, always 3 bytes */
needlen += strlen(httpd->retmsg) + 2; /* return msg + CRLF */ 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); result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); 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 + strlen(val); /* :<space> and val */
needlen += 2; /* CRLF */ needlen += 2; /* CRLF */
if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
result = grow_headerspace(httpd); result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);
@ -869,7 +869,7 @@ isc_httpd_endheaders(isc_httpd_t *httpd)
{ {
isc_result_t result; isc_result_t result;
if (isc_buffer_availablelength(&httpd->headerbuffer) < 2) { while (isc_buffer_availablelength(&httpd->headerbuffer) < 2) {
result = grow_headerspace(httpd); result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); 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 + strlen(buf); /* :<space> and val */
needlen += 2; /* CRLF */ needlen += 2; /* CRLF */
if (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) { while (isc_buffer_availablelength(&httpd->headerbuffer) < needlen) {
result = grow_headerspace(httpd); result = grow_headerspace(httpd);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
return (result); return (result);