From cvs-return-17131-apmail-httpd-cvs-archive=httpd.apache.org@httpd.apache.org Mon Oct 13 19:18:25 2003 Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 68861 invoked from network); 13 Oct 2003 19:18:24 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 13 Oct 2003 19:18:24 -0000 Received: (qmail 66008 invoked by uid 500); 13 Oct 2003 19:18:14 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 65955 invoked by uid 500); 13 Oct 2003 19:18:13 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 65936 invoked by uid 500); 13 Oct 2003 19:18:13 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Received: (qmail 65859 invoked from network); 13 Oct 2003 19:18:12 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 13 Oct 2003 19:18:12 -0000 Received: (qmail 68811 invoked by uid 1121); 13 Oct 2003 19:18:22 -0000 Date: 13 Oct 2003 19:18:22 -0000 Message-ID: <20031013191822.68810.qmail@minotaur.apache.org> From: trawick@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0 CHANGES STATUS X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N 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 . httpd-2.0's config parser doesn't like container directives with no arguments (Syntax