httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Wed, 02 Jun 2004 22:40:23 GMT
nd          2004/06/02 15:40:23

  Modified:    .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
               modules/metadata Tag: APACHE_2_0_BRANCH mod_setenvif.c
                        mod_usertrack.c
               modules/proxy Tag: APACHE_2_0_BRANCH mod_proxy.c proxy_ftp.c
               server   Tag: APACHE_2_0_BRANCH core.c
  Log:
  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
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.988.2.292 +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.291
  retrieving revision 1.988.2.292
  diff -u -u -r1.988.2.291 -r1.988.2.292
  --- CHANGES	1 Jun 2004 20:27:10 -0000	1.988.2.291
  +++ CHANGES	2 Jun 2004 22:40:21 -0000	1.988.2.292
  @@ -1,5 +1,9 @@
   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.751.2.896 +1 -12     httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.895
  retrieving revision 1.751.2.896
  diff -u -u -r1.751.2.895 -r1.751.2.896
  --- STATUS	2 Jun 2004 14:30:40 -0000	1.751.2.895
  +++ STATUS	2 Jun 2004 22:40:21 -0000	1.751.2.896
  @@ -179,17 +179,6 @@
            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
  
  
  
  No                   revision
  No                   revision
  1.38.2.8  +5 -4      httpd-2.0/modules/metadata/mod_setenvif.c
  
  Index: mod_setenvif.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_setenvif.c,v
  retrieving revision 1.38.2.7
  retrieving revision 1.38.2.8
  diff -u -u -r1.38.2.7 -r1.38.2.8
  --- mod_setenvif.c	9 Feb 2004 20:53:19 -0000	1.38.2.7
  +++ mod_setenvif.c	2 Jun 2004 22:40:22 -0000	1.38.2.8
  @@ -174,11 +174,12 @@
        */
       regex_t *preg = ap_pregcomp(p, "^[-A-Za-z0-9_]*$",
                                   (REG_EXTENDED | REG_NOSUB ));
  -    if (preg) {
  -        if (ap_regexec(preg, name, 0, NULL, 0)) {
  -            return 1;
  -        }
  +    ap_assert(preg != NULL);
  +
  +    if (ap_regexec(preg, name, 0, NULL, 0)) {
  +        return 1;
       }
  +
       return 0;
   }
   
  
  
  
  1.39.2.10 +1 -0      httpd-2.0/modules/metadata/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/metadata/mod_usertrack.c,v
  retrieving revision 1.39.2.9
  retrieving revision 1.39.2.10
  diff -u -u -r1.39.2.9 -r1.39.2.10
  --- mod_usertrack.c	8 Mar 2004 23:29:11 -0000	1.39.2.9
  +++ mod_usertrack.c	2 Jun 2004 22:40:22 -0000	1.39.2.10
  @@ -168,6 +168,7 @@
       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)
  
  
  
  No                   revision
  No                   revision
  1.90.2.7  +6 -0      httpd-2.0/modules/proxy/mod_proxy.c
  
  Index: mod_proxy.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/mod_proxy.c,v
  retrieving revision 1.90.2.6
  retrieving revision 1.90.2.7
  diff -u -u -r1.90.2.6 -r1.90.2.7
  --- mod_proxy.c	9 Feb 2004 20:53:19 -0000	1.90.2.6
  +++ mod_proxy.c	2 Jun 2004 22:40:23 -0000	1.90.2.7
  @@ -945,6 +945,9 @@
        */
       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 @@
           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 */
  
  
  
  1.130.2.8 +1 -0      httpd-2.0/modules/proxy/proxy_ftp.c
  
  Index: proxy_ftp.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_ftp.c,v
  retrieving revision 1.130.2.7
  retrieving revision 1.130.2.8
  diff -u -u -r1.130.2.7 -r1.130.2.8
  --- proxy_ftp.c	26 May 2004 12:00:58 -0000	1.130.2.7
  +++ proxy_ftp.c	2 Jun 2004 22:40:23 -0000	1.130.2.8
  @@ -430,6 +430,7 @@
   
           /* Compile the output format of "ls -s1" as a fallback for non-unix ftp listings
*/
           re = ap_pregcomp(p, LS_REG_PATTERN, REG_EXTENDED);
  +        ap_assert(re != NULL);
   
           /* get a complete line */
           /* if the buffer overruns - throw data away */
  
  
  
  No                   revision
  No                   revision
  1.225.2.21 +18 -0     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.225.2.20
  retrieving revision 1.225.2.21
  diff -u -u -r1.225.2.20 -r1.225.2.21
  --- core.c	30 Mar 2004 20:49:07 -0000	1.225.2.20
  +++ core.c	2 Jun 2004 22:40:23 -0000	1.225.2.21
  @@ -1623,9 +1623,15 @@
           if (!cmd->path)
               return "<Directory ~ > block must specify a path";
           r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
  +        if (!r) {
  +            return "Regex could not be compiled";
  +        }
       }
       else if (thiscmd->cmd_data) { /* <DirectoryMatch> */
           r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
  +        if (!r) {
  +            return "Regex could not be compiled";
  +        }
       }
       else if (!strcmp(cmd->path, "/") == 0)
       {
  @@ -1707,10 +1713,16 @@
   
       if (thiscmd->cmd_data) { /* <LocationMatch> */
           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);
           r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
  +        if (!r) {
  +            return "Regex could not be compiled";
  +        }
       }
   
       /* initialize our config and fetch it */
  @@ -1769,10 +1781,16 @@
   
       if (thiscmd->cmd_data) { /* <FilesMatch> */
           r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
  +        if (!r) {
  +            return "Regex could not be compiled";
  +        }
       }
       else if (!strcmp(cmd->path, "~")) {
           cmd->path = ap_getword_conf(cmd->pool, &arg);
           r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
  +        if (!r) {
  +            return "Regex could not be compiled";
  +        }
       }
       else {
           char *newpath;
  
  
  

Mime
View raw message