]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
grab this fix from 2.1-dev:
authorJeff Trawick <trawick@apache.org>
Mon, 26 Apr 2004 15:58:31 +0000 (15:58 +0000)
committerJeff Trawick <trawick@apache.org>
Mon, 26 Apr 2004 15:58:31 +0000 (15:58 +0000)
 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:    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

CHANGES
STATUS
modules/arch/win32/mod_isapi.c

diff --git a/CHANGES b/CHANGES
index e0e9be27954617a9de6cf0b273f6f3fb7dd4f564..4a967ea91e1703655335c38f2f30459efb1f6673 100644 (file)
--- 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 <jsp pkc.com>]
+
   *) mod_isapi: GetServerVariable("ALL_RAW") returned the wrong buffer
      size.  PR 20617.  [Jesse Pelton <jsp pkc.com>]
 
diff --git a/STATUS b/STATUS
index c079f5cc7d44579bc6c36890442f4032807d8ec0..49efce93b9e13175aba619e0bc5e583a4011506e 100644 (file)
--- 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 <jsp pkc.com>]
-      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
index 705ea150d7c471da7ec8e03aab4ff6f7b595aeed..0ed08aa930053906695eee3fb9a2b9e4edd24102 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';