diff options
| author | Scott MacVicar <scottmac@php.net> | 2007-06-18 15:52:46 +0000 |
|---|---|---|
| committer | Scott MacVicar <scottmac@php.net> | 2007-06-18 15:52:46 +0000 |
| commit | b73d2a94ae615cb530b8cc9548d1a2bd06b57ed4 (patch) | |
| tree | 673b0510e4dc3a348830a8d989224c79374095d3 /sapi/apache | |
| parent | d3f2d039a5d75f82a4b5a3804c12dc1eb9f48bb9 (diff) | |
| download | php-git-b73d2a94ae615cb530b8cc9548d1a2bd06b57ed4.tar.gz | |
Fixed bug #41628 (PHP settings leak between Virtual Hosts in Apache 1.3).
Diffstat (limited to 'sapi/apache')
| -rw-r--r-- | sapi/apache/mod_php5.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 344e705028..439ef168e7 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -764,9 +764,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), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); - 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), (merge_checker_func_t) should_overwrite_per_dir_entry, NULL); + return new; } /* }}} */ |
