From: Jeff Trawick Date: Mon, 16 Feb 2004 17:57:26 +0000 (+0000) Subject: mod_isapi: GetServerVariable returned improperly terminated header X-Git-Tag: pre_ajp_proxy~660 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81d57e7d392f63537a494db72da3e8aaeab2b754;p=apache mod_isapi: GetServerVariable returned improperly terminated header fields given "ALL_HTTP" or "ALL_RAW". PR: 20656 Submitted by: Jesse Pelton Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102643 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 9a4734ecf3..dcf9552c31 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,10 @@ Changes with Apache 2.1.0-dev [Remove entries to the current 2.0 section below, when backported] + *) mod_isapi: GetServerVariable returned improperly terminated header + fields given "ALL_HTTP" or "ALL_RAW". PR 20656. + [Jesse Pelton ] + *) mod_isapi: send_response_header() failed to copy status string's last character. PR 20619. [Jesse Pelton ] diff --git a/modules/arch/win32/mod_isapi.c b/modules/arch/win32/mod_isapi.c index b34cfcba30..e097c3d9d6 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';