Commit a7ae5b7f authored by Jeff Trawick's avatar Jeff Trawick
Browse files

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 <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
parent 1851b6e7
Loading
Loading
Loading
Loading
+4 −0
Changes for CHANGES: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
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>]
+1 −7
Changes for STATUS: 1 added line, 7 removed lines.
Original line number Diff line number Diff line
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
+6 −4
Changes for modules/arch/win32/mod_isapi.c: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -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';