]> granicus.if.org Git - apache/commitdiff
mod_isapi: GetServerVariable returned improperly terminated header
authorJeff Trawick <trawick@apache.org>
Mon, 16 Feb 2004 17:57:26 +0000 (17:57 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 16 Feb 2004 17:57:26 +0000 (17:57 +0000)
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

CHANGES
modules/arch/win32/mod_isapi.c

diff --git a/CHANGES b/CHANGES
index 9a4734ecf3af1dc321a5bcb329b42c8a596777be..dcf9552c31068327bd7f3faf1d0e8b2a6a9f9806 100644 (file)
--- 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 <jsp pkc.com>]
+
   *) mod_isapi: send_response_header() failed to copy status string's 
      last character.  PR 20619.  [Jesse Pelton <jsp pkc.com>]
 
index b34cfcba30d51a0108e246d463cb98410aa2f519..e097c3d9d6a84a2b84c21db17088bd1e6270811d 100644 (file)
@@ -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';