From: Jeff Trawick Date: Mon, 26 Apr 2004 15:58:31 +0000 (+0000) Subject: grab this fix from 2.1-dev: X-Git-Tag: 2.0.50~155 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=974a0cdaed864c30821fadde0311fad7bb3b72dd;p=thirdparty%2Fapache%2Fhttpd.git grab this fix from 2.1-dev: mod_isapi: GetServerVariable returned improperly terminated header fields given "ALL_HTTP" or "ALL_RAW". PR: 20656 Submitted by: Jesse Pelton Reviewed by: trawick, stoddard, nd git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103528 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index e0e9be27954..4a967ea91e1 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 2.0.50 + *) mod_isapi: GetServerVariable returned improperly terminated header + fields given "ALL_HTTP" or "ALL_RAW". PR 20656. + [Jesse Pelton ] + *) mod_isapi: GetServerVariable("ALL_RAW") returned the wrong buffer size. PR 20617. [Jesse Pelton ] diff --git a/STATUS b/STATUS index c079f5cc7d4..49efce93b9e 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2004/04/26 15:54:22 $] +Last modified at [$Date: 2004/04/26 15:58:31 $] Release: @@ -358,12 +358,6 @@ PATCHES TO BACKPORT FROM 2.1 http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/arch/win32/mod_isapi.c?r1=1.97&r2=1.98 +1: trawick, stoddard - * mod_isapi: GetServerVariable returned improperly terminated header - fields given "ALL_HTTP" or "ALL_RAW". PR 20656. - [Jesse Pelton ] - http://cvs.apache.org/viewcvs.cgi/httpd-2.0/modules/arch/win32/mod_isapi.c?r1=1.98&r2=1.99 - +1: trawick, stoddard, nd - * Unix MPMs: Stop dropping connections when the file descriptor is at least FD_SETSIZE os/unix/unixd.c: r1.63 diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index 705ea150d7c..0ed08aa9300 100644 --- a/modules/arch/win32/mod_isapi.c +++ b/modules/arch/win32/mod_isapi.c @@ -495,7 +495,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, if (!strcmp(variable_name, "ALL_HTTP")) { - /* lf delimited, colon split, comma seperated and + /* crlf delimited, colon split, comma separated and * null terminated list of HTTP_ vars */ const apr_array_header_t *arr = apr_table_elts(r->subprocess_env); @@ -504,7 +504,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, for (len = 0, i = 0; i < arr->nelts; i++) { if (!strncmp(elts[i].key, "HTTP_", 5)) { - len += strlen(elts[i].key) + strlen(elts[i].val) + 2; + len += strlen(elts[i].key) + strlen(elts[i].val) + 3; } } @@ -521,6 +521,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, *(((char*)buf_data)++) = ':'; strcpy(buf_data, elts[i].val); ((char*)buf_data) += strlen(elts[i].val); + *(((char*)buf_data)++) = '\r'; *(((char*)buf_data)++) = '\n'; } } @@ -532,7 +533,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, if (!strcmp(variable_name, "ALL_RAW")) { - /* lf delimited, colon split, comma seperated and + /* crlf delimited, colon split, comma separated and * null terminated list of the raw request header */ const apr_array_header_t *arr = apr_table_elts(r->headers_in); @@ -540,7 +541,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, int i; for (len = 0, i = 0; i < arr->nelts; i++) { - len += strlen(elts[i].key) + strlen(elts[i].val) + 3; + len += strlen(elts[i].key) + strlen(elts[i].val) + 4; } if (*buf_size < len + 1) { @@ -556,6 +557,7 @@ int APR_THREAD_FUNC GetServerVariable (isapi_cid *cid, *(((char*)buf_data)++) = ' '; strcpy(buf_data, elts[i].val); ((char*)buf_data) += strlen(elts[i].val); + *(((char*)buf_data)++) = '\r'; *(((char*)buf_data)++) = '\n'; } *(((char*)buf_data)++) = '\0';