httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0 CHANGES STATUS
Date Mon, 13 Oct 2003 19:18:22 GMT
trawick     2003/10/13 12:18:22

  Modified:    modules/generators Tag: APACHE_2_0_BRANCH mod_cgid.c
               .        Tag: APACHE_2_0_BRANCH CHANGES STATUS
  Log:
  merge this fix into the stable branch:
  
         mod_cgid: fix a hash table corruption problem which could
         result in the wrong script being cleaned up at the end of a
         request.
  
  Reviewed by:	stoddard, gregames
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.145.2.8 +20 -1     httpd-2.0/modules/generators/mod_cgid.c
  
  Index: mod_cgid.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/generators/mod_cgid.c,v
  retrieving revision 1.145.2.7
  retrieving revision 1.145.2.8
  diff -u -r1.145.2.7 -r1.145.2.8
  --- mod_cgid.c	17 Sep 2003 10:53:32 -0000	1.145.2.7
  +++ mod_cgid.c	13 Oct 2003 19:18:21 -0000	1.145.2.8
  @@ -769,7 +769,26 @@
                                apr_filename_of_pathname(r->filename));
               }
               else {
  -                apr_hash_set(script_hash, &cgid_req.conn_id, sizeof(cgid_req.conn_id),

  +                /* We don't want to leak storage for the key, so only allocate
  +                 * a key if the key doesn't exist yet in the hash; there are
  +                 * only a limited number of possible keys (one for each
  +                 * possible thread in the server), so we can allocate a copy
  +                 * of the key the first time a thread has a cgid request.
  +                 * Note that apr_hash_set() only uses the storage passed in
  +                 * for the key if it is adding the key to the hash for the
  +                 * first time; new key storage isn't needed for replacing the
  +                 * existing value of a key.
  +                 */
  +                void *key;
  +
  +                if (apr_hash_get(script_hash, &cgid_req.conn_id, sizeof(cgid_req.conn_id)))
{
  +                    key = &cgid_req.conn_id;
  +                }
  +                else {
  +                    key = apr_pcalloc(pcgi, sizeof(cgid_req.conn_id));
  +                    memcpy(key, &cgid_req.conn_id, sizeof(cgid_req.conn_id));
  +                }
  +                apr_hash_set(script_hash, key, sizeof(cgid_req.conn_id),
                                (void *)procnew->pid);
               }
           }
  
  
  
  No                   revision
  No                   revision
  1.988.2.170 +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.988.2.169
  retrieving revision 1.988.2.170
  diff -u -r1.988.2.169 -r1.988.2.170
  --- CHANGES	11 Oct 2003 01:47:43 -0000	1.988.2.169
  +++ CHANGES	13 Oct 2003 19:18:21 -0000	1.988.2.170
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.48
   
  +  *) mod_cgid: fix a hash table corruption problem which could
  +     result in the wrong script being cleaned up at the end of a
  +     request.  [Jeff Trawick]
  +
     *) Update httpd-*.conf to be clearer in describing the connection
        between AddType and AddEncoding for defining the meaning of
        compressed file extensions. [Roy Fielding]
  
  
  
  1.751.2.498 +1 -7      httpd-2.0/STATUS
  
  Index: STATUS
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/STATUS,v
  retrieving revision 1.751.2.497
  retrieving revision 1.751.2.498
  diff -u -r1.751.2.497 -r1.751.2.498
  --- STATUS	13 Oct 2003 17:28:08 -0000	1.751.2.497
  +++ STATUS	13 Oct 2003 19:18:21 -0000	1.751.2.498
  @@ -260,12 +260,6 @@
           modules/generators/mod_info.c r1.151
         +1: trawick
   
  -    * mod_cgid: fix a hash table corruption problem which could
  -      result in the wrong script being cleaned up at the end of a
  -      request.
  -        modules/generators/mod_cgid.c r1.157
  -      +1: trawick, stoddard, gregames
  -
       * httpd-2.0's config parser is incompatible with httpd-1.3's one,
         which allowed containers like <Perl>. httpd-2.0's config parser
         doesn't like container directives with no arguments (Syntax
  
  
  

Mime
View raw message