diff options
author | Scott MacVicar <scottmac@php.net> | 2007-06-18 15:53:15 +0000 |
---|---|---|
committer | Scott MacVicar <scottmac@php.net> | 2007-06-18 15:53:15 +0000 |
commit | 166366a763d6a2a74f418a750ad3b0d92fc8407e (patch) | |
tree | 10eb0a9987fe44a390b6840fe743354b5bd4c556 | |
parent | 5f8e696b085709654786872bdea77d660e87125d (diff) | |
download | php-git-166366a763d6a2a74f418a750ad3b0d92fc8407e.tar.gz |
MFB: Fixed bug #41628 (PHP settings leak between Virtual Hosts in Apache 1.3).
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | sapi/apache/mod_php4.c | 12 |
2 files changed, 11 insertions, 3 deletions
@@ -10,6 +10,8 @@ PHP 4 NEWS input variables. Fix for MOPB-03-2007. (Stas) - Fixed bug #41630 (segfault when an invalid color index is present in the image data). (Reported by Elliot <wccoder@gmail dot com>) (Pierre) +- Fixed bug #41628 (PHP settings leak between Virtual Hosts in + Apache 1.3). (Scott, manuel at mausz dot at) - Fixed bug #38798 (OpenSSL init corrected in php5 but not in php4). (Tony) 04 May 2007, Version 4.4.7 diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 2ed02975dc..9b09e2bfe0 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -728,9 +728,15 @@ static void *php_create_dir(pool *p, char *dummy) */ static void *php_merge_dir(pool *p, void *basev, void *addv) { - /* This function *must* return addv, and not modify basev */ - zend_hash_merge_ex((HashTable *) addv, (HashTable *) basev, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (zend_bool (*)(void *, void *)) should_overwrite_per_dir_entry); - return addv; + /* This function *must* not modify addv or basev */ + HashTable *new; + + /* need a copy of addv to merge */ + new = php_create_dir(p, "php_merge_dir"); + zend_hash_copy(new, (HashTable *) addv, (copy_ctor_func_t) copy_per_dir_entry, NULL, sizeof(php_per_dir_entry)); + + zend_hash_merge_ex(new, (HashTable *) basev, (copy_ctor_func_t) copy_per_dir_entry, sizeof(php_per_dir_entry), (zend_bool (*)(void *, void *)) should_overwrite_per_dir_entry); + return new; } /* }}} */ |