Commit 61172308 authored by Andre Malo's avatar Andre Malo
Browse files

Fix a bunch of cases where the return code of the regex compiler

was not checked properly. This affects: mod_setenvif, mod_usertrack,
mod_proxy, mod_proxy_ftp and core.

PR: 28218
Reviewed by: Jeff Trawick, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@103823 13f79535-47bb-0310-9956-ffa450edef68
parent ff75ae6f
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
  *) Fix a bunch of cases where the return code of the regex compiler
     was not checked properly. This affects: mod_setenvif, mod_usertrack,
     mod_proxy, mod_proxy_ftp and core. PR 28218.  [André Malo]
  *) mod_ssl: Fix a potential segfault in the 'shmcb' session cache for
     small cache sizes.  PR 27751.  [Geoff Thorpe <geoff geoffthorpe.net>]
+1 −12
Changes for STATUS: 1 added line, 12 removed lines.
Original line number Diff line number Diff line
APACHE 2.0 STATUS:                                              -*-text-*-
Last modified at [$Date: 2004/06/02 14:30:40 $]
Last modified at [$Date: 2004/06/02 22:40:21 $]

Release:

@@ -179,17 +179,6 @@ PATCHES TO BACKPORT FROM 2.1
         modules/loggers/mod_log_config.c: r1.116
       +1: nd

    *) Fix a bunch of cases where the return code of the regex compiler
       was not checked properly. The 1.3-diff is here:
       http://www.apache.org/~nd/regex-return-1.3.diff (only core and
       mod_usertrack affected). PR 28218.
         modules/metadata/mod_setenvif.c: r1.51
         modules/metadata/mod_usertrack.c: r1.52
         modules/proxy/mod_proxy.c: r1.99
         modules/proxy/proxy_ftp.c: r1.140
         server/core.c: r1.272
       +1: nd, trawick, jorton

    *) mod_usertrack: Escape the cookie_name before pasting into the regexp.
       (2.0 + 1.3)
         modules/metadata/mod_usertrack.c: r1.51
+3 −2
Changes for modules/metadata/mod_setenvif.c: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -174,11 +174,12 @@ static int is_header_regex(apr_pool_t *p, const char* name)
     */
    regex_t *preg = ap_pregcomp(p, "^[-A-Za-z0-9_]*$",
                                (REG_EXTENDED | REG_NOSUB ));
    if (preg) {
    ap_assert(preg != NULL);

    if (ap_regexec(preg, name, 0, NULL, 0)) {
        return 1;
    }
    }

    return 0;
}

+1 −0
Changes for modules/metadata/mod_usertrack.c: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ static void set_and_comp_regexp(cookie_dir_rec *dcfg,
    dcfg->regexp_string = apr_pstrcat(p, "^", cookie_name, "=([^;]+)|;[ \t]+", cookie_name, "=([^;]+)", NULL);

    dcfg->regexp = ap_pregcomp(p, dcfg->regexp_string, REG_EXTENDED);
    ap_assert(dcfg->regexp != NULL);
}

static int spot_cookie(request_rec *r)
+6 −0
Changes for modules/proxy/mod_proxy.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -945,6 +945,9 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg)
     */
    if (thiscmd->cmd_data) { /* <ProxyMatch> */
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
        if (!r) {
            return "Regex could not be compiled";
        }
    }
    else if (!strcmp(cmd->path, "~")) {
        cmd->path = ap_getword_conf(cmd->pool, &arg);
@@ -953,6 +956,9 @@ static const char *proxysection(cmd_parms *cmd, void *mconfig, const char *arg)
        if (strncasecmp(cmd->path, "proxy:", 6))
            cmd->path += 6;
        r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
        if (!r) {
            return "Regex could not be compiled";
        }
    }

    /* initialize our config and fetch it */
Loading