You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2014/03/12 13:28:03 UTC

svn commit: r1576709 - in /httpd/httpd/branches/2.2.x: ./ modules/aaa/ modules/ldap/ modules/metadata/ modules/proxy/ os/win32/

Author: rpluem
Date: Wed Mar 12 12:28:03 2014
New Revision: 1576709

URL: http://svn.apache.org/r1576709
Log:
Merge r1493330, r1504276, r1552227, r1551714, r1490994, r1172732 from trunk:

Correct typo in error message

Unlikely potential memory leak.
Point 12 of PR 54936

Remove <Proxy ~ wildcard-url> syntax which:
   - is equivalent to <ProxyMatch wildcard-url>
   - has never been documented
   - incorrectly checks parameters (!cmd->path should be !cmd->path[0])
   - is buggy (! is missing in front of strncasecmp)

Avoid sending back uninitialized memory, use 'ftpmessage' in order to have something meaningful instead.

Save 8k of stack by the same time.

NULL terminate the right buffer

Fix issues found by PVS-Studio static analyzer:

mod_mime_magic:
cut'n'paste error rsl_encoding vs. rsl_separator, also simplify code a bit

mod_header:
wrong string initialization (leading to segfault if format argument is missing)

util_win32: duplicate sizeof (untested; Windows people, please review)

PR: 51542
Submitted by: Andrey Karpov <karpov viva64 com>, Stefan Fritsch

Reviewed by: jailletc36, rpluem, wrowe

Modified:
    httpd/httpd/branches/2.2.x/   (props changed)
    httpd/httpd/branches/2.2.x/CHANGES
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/aaa/mod_authnz_ldap.c
    httpd/httpd/branches/2.2.x/modules/ldap/util_ldap_cache.c
    httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
    httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c
    httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c
    httpd/httpd/branches/2.2.x/os/win32/util_win32.c

Propchange: httpd/httpd/branches/2.2.x/
------------------------------------------------------------------------------
  Merged /httpd/httpd/trunk:r1172732,1490994,1493330,1504276,1551714,1552227

Modified: httpd/httpd/branches/2.2.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Mar 12 12:28:03 2014
@@ -7,6 +7,15 @@ Changes with Apache 2.2.27
   *) mod_proxy_http: Core dumped under high load. PR 50335.
      [Jan Kaluza <jkaluza redhat.com>]
 
+  *) proxy_util: NULL terminate the right buffer in 'send_http_connect'.
+     [Christophe Jaillet]
+
+  *) mod_proxy: Remove (never documented) <Proxy ~ wildcard-url> syntax which
+     is equivalent to <ProxyMatch wildcard-url>. [Christophe Jaillet]
+
+  *) mod_ldap: Fix a potential memory leak or corruption.  PR 54936.
+     [Zhenbo Xu <zhenbo1987 gmail com>]
+
   *) mod_rewrite: Add mod_rewrite.h to the headers installed on Windows. 
      PR46679 [Bob Ionescu]
 

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Mar 12 12:28:03 2014
@@ -98,30 +98,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  * back port some bugfix that have already been included in 2.4.x. CHANGES has
-    been upgraded with the corresponding entries.
-   - Correct typo in error message
-   - Unlikely potential memory leak. PR 54936
-   - Remove <Proxy ~ wildcard-url> syntax which:
-      - is equivalent to <ProxyMatch wildcard-url>
-      - has never been documented
-      - incorrectly checks parameters (!cmd->path should be !cmd->path[0])
-      - is buggy (! is missing in front of strncasecmp)
-   - Avoid sending back uninitialized memory, use 'ftpmessage' in order to have
-     something meaningful instead.
-     Save 8k of stack by the same time.
-   - NULL terminate the right buffer
-   - mod_header: wrong string initialization (leading to segfault if format argument is missing)   
-     util_win32: duplicate sizeof (untested; Windows people, please review)
-   trunk patch: http://svn.apache.org/viewvc?view=revision&revision=r1493330
-                http://svn.apache.org/viewvc?view=revision&revision=r1504276
-                http://svn.apache.org/viewvc?view=revision&revision=r1552227
-                http://svn.apache.org/viewvc?view=revision&revision=r1551714
-                http://svn.apache.org/viewvc?view=revision&revision=r1490994
-                http://svn.apache.org/viewvc?view=revision&revision=r1172732
-    2.2.x patch: http://people.apache.org/~jailletc36/patch_2.2.diff
-    +1: jailletc36, rpluem, wrowe
-
  * mod_ssl: Do not perform SNI / Host header comparison in case of a
    forward proxy request.
      Trunk version of patch:

Modified: httpd/httpd/branches/2.2.x/modules/aaa/mod_authnz_ldap.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/aaa/mod_authnz_ldap.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/aaa/mod_authnz_ldap.c (original)
+++ httpd/httpd/branches/2.2.x/modules/aaa/mod_authnz_ldap.c Wed Mar 12 12:28:03 2014
@@ -1048,7 +1048,7 @@ static const char *mod_auth_ldap_set_der
         sec->deref = always;
     }
     else {
-        return "Unrecognized value for AuthLDAPAliasDereference directive";
+        return "Unrecognized value for AuthLDAPDereferenceAliases directive";
     }
     return NULL;
 }

Modified: httpd/httpd/branches/2.2.x/modules/ldap/util_ldap_cache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/ldap/util_ldap_cache.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/ldap/util_ldap_cache.c (original)
+++ httpd/httpd/branches/2.2.x/modules/ldap/util_ldap_cache.c Wed Mar 12 12:28:03 2014
@@ -52,7 +52,7 @@ void *util_ldap_url_node_copy(util_ald_c
 
     if (node) {
         if (!(node->url = util_ald_strdup(cache, n->url))) {
-            util_ald_free(cache, node->url);
+            util_ald_free(cache, node);
             return NULL;
         }
         node->search_cache = n->search_cache;

Modified: httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c (original)
+++ httpd/httpd/branches/2.2.x/modules/metadata/mod_headers.c Wed Mar 12 12:28:03 2014
@@ -327,7 +327,7 @@ static char *parse_format_tag(apr_pool_t
         return NULL;
     }
 
-    tag->arg = '\0';
+    tag->arg = "\0";
     /* grab the argument if there is one */
     if (*s == '{') {
         ++s;

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Wed Mar 12 12:28:03 2014
@@ -2005,17 +2005,6 @@ static const char *proxysection(cmd_parm
             return "Regex could not be compiled";
         }
     }
-    else if (!strcmp(cmd->path, "~")) {
-        cmd->path = ap_getword_conf(cmd->pool, &arg);
-        if (!cmd->path)
-            return "<Proxy ~ > block must specify a path";
-        if (strncasecmp(cmd->path, "proxy:", 6))
-            cmd->path += 6;
-        r = ap_pregcomp(cmd->pool, cmd->path, AP_REG_EXTENDED);
-        if (!r) {
-            return "Regex could not be compiled";
-        }
-    }
 
     /* initialize our config and fetch it */
     conf = ap_set_config_vectors(cmd->server, new_dir_conf, cmd->path,

Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_ftp.c Wed Mar 12 12:28:03 2014
@@ -812,7 +812,6 @@ static int proxy_ftp_handler(request_rec
     apr_bucket_brigade *bb = apr_brigade_create(p, c->bucket_alloc);
     char *buf, *connectname;
     apr_port_t connectport;
-    char buffer[MAX_STRING_LEN];
     char *ftpmessage = NULL;
     char *path, *strp, *type_suffix, *cwd = NULL;
     apr_uri_t uri;
@@ -1446,7 +1445,7 @@ static int proxy_ftp_handler(request_rec
                                       "Error reading from remote server");
             }
             if (rc != 200) {
-                return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, buffer);
+                return ftp_proxyerror(r, backend, HTTP_BAD_GATEWAY, ftpmessage);
             }
 
             /* signal that we must use the EPRT/PORT loop */

Modified: httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c Wed Mar 12 12:28:03 2014
@@ -2329,7 +2329,7 @@ static apr_status_t send_http_connect(pr
         nbytes = sizeof(drain_buffer) - 1;
         while (status == APR_SUCCESS && nbytes) {
             status = apr_socket_recv(backend->sock, drain_buffer, &nbytes);
-            buffer[nbytes] = '\0';
+            drain_buffer[nbytes] = '\0';
             nbytes = sizeof(drain_buffer) - 1;
             if (strstr(drain_buffer, "\r\n\r\n") != NULL) {
                 complete = 1;

Modified: httpd/httpd/branches/2.2.x/os/win32/util_win32.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/os/win32/util_win32.c?rev=1576709&r1=1576708&r2=1576709&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/os/win32/util_win32.c (original)
+++ httpd/httpd/branches/2.2.x/os/win32/util_win32.c Wed Mar 12 12:28:03 2014
@@ -112,7 +112,7 @@ PSECURITY_ATTRIBUTES GetNullACL(void)
     PSECURITY_ATTRIBUTES sa;
 
     sa  = (PSECURITY_ATTRIBUTES) LocalAlloc(LPTR, sizeof(SECURITY_ATTRIBUTES));
-    sa->nLength = sizeof(sizeof(SECURITY_ATTRIBUTES));
+    sa->nLength = sizeof(SECURITY_ATTRIBUTES);
 
     pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, SECURITY_DESCRIPTOR_MIN_LENGTH);
     sa->lpSecurityDescriptor = pSD;