diff options
author | Jeff Trawick <trawick@apache.org> | 2004-02-16 18:57:26 +0100 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2004-02-16 18:57:26 +0100 |
commit | 81d57e7d392f63537a494db72da3e8aaeab2b754 (patch) | |
tree | 38d15adfd6723fdaeb17c885b4c92299b3a5f4ea /modules | |
parent | mod_isapi: send_response_header() failed to copy status string's (diff) | |
download | apache2-81d57e7d392f63537a494db72da3e8aaeab2b754.tar.xz apache2-81d57e7d392f63537a494db72da3e8aaeab2b754.zip |
mod_isapi: GetServerVariable returned improperly terminated header
fields given "ALL_HTTP" or "ALL_RAW".
PR: 20656
Submitted by: Jesse Pelton <jsp pkc.com>
Reviewed by: Jeff Trawick
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102643 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules')
-rw-r--r-- | modules/arch/win32/mod_isapi.c | 10 |
1 files changed, 6 insertions, 4 deletions
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'; |