httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: apache-1.3/src/modules/standard mod_usertrack.c
Date Wed, 02 Jun 2004 22:49:03 GMT
nd          2004/06/02 15:49:03

  Modified:    src      CHANGES
               src/main http_core.c
               src/modules/standard mod_usertrack.c
  Log:
  Fix a bunch of cases where the return code of the regex compiler
  was not checked properly. This affects mod_usertrack and core.
  
  PR: 28218
  Reviewed by: Jeff Trawick, Joe Orton
  
  Revision  Changes    Path
  1.1942    +4 -0      apache-1.3/src/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/CHANGES,v
  retrieving revision 1.1941
  retrieving revision 1.1942
  diff -u -u -r1.1941 -r1.1942
  --- CHANGES	28 May 2004 12:22:04 -0000	1.1941
  +++ CHANGES	2 Jun 2004 22:49:03 -0000	1.1942
  @@ -1,5 +1,9 @@
   Changes with Apache 1.3.32
   
  +  *) Fix a bunch of cases where the return code of the regex compiler
  +     was not checked properly. This affects mod_usertrack and
  +     core. PR 28218.  [André Malo]
  +
     *) No longer breaks mod_dav, frontpage and others.  Backs out
        a patch which prevented discarding the request body for requests
        that will be keptalive but are not currently keptalive. PR 29237.
  
  
  
  1.337     +26 -8     apache-1.3/src/main/http_core.c
  
  Index: http_core.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/main/http_core.c,v
  retrieving revision 1.336
  retrieving revision 1.337
  diff -u -u -r1.336 -r1.337
  --- http_core.c	12 May 2004 18:21:22 -0000	1.336
  +++ http_core.c	2 Jun 2004 22:49:03 -0000	1.337
  @@ -1602,11 +1602,17 @@
       cmd->override = OR_ALL|ACCESS_CONF;
   
       if (thiscmd->cmd_data) { /* <DirectoryMatch> */
  -	r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
  +        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);
  +        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";
  +        }
       }
   #if defined(HAVE_DRIVE_LETTERS) || defined(NETWARE)
       else if (strcmp(cmd->path, "/") == 0) {
  @@ -1683,11 +1689,17 @@
       cmd->override = OR_ALL|ACCESS_CONF;
   
       if (thiscmd->cmd_data) { /* <LocationMatch> */
  -	r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED);
  +        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);
  +        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";
  +        }
       }
   
       old_end_token = cmd->end_token;
  @@ -1755,10 +1767,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);
  +        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 {
   	/* Ensure that the pathname is canonical */
  
  
  
  1.64      +1 -0      apache-1.3/src/modules/standard/mod_usertrack.c
  
  Index: mod_usertrack.c
  ===================================================================
  RCS file: /home/cvs/apache-1.3/src/modules/standard/mod_usertrack.c,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -u -r1.63 -r1.64
  --- mod_usertrack.c	20 Feb 2004 20:38:27 -0000	1.63
  +++ mod_usertrack.c	2 Jun 2004 22:49:03 -0000	1.64
  @@ -264,6 +264,7 @@
                                        "=([^;]+)|;[ \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)
  
  
  

Mime
View raw message