diff options
author | Zeev Suraski <zeev@php.net> | 2001-07-02 18:17:10 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2001-07-02 18:17:10 +0000 |
commit | 551f1831a7dc0ef96082a6f95f565553be590798 (patch) | |
tree | 24793ff58625dbd68364233fd5d9d687b4adcb18 /ext/standard/output.c | |
parent | 610ebfe3de1c0a1acd63bb7e20bed9a997760413 (diff) | |
download | php-git-551f1831a7dc0ef96082a6f95f565553be590798.tar.gz |
Fix a major thread safety bug in the output mechanism
@- Fixed a major memory corruption bug in the thread safe version (Zeev)
Diffstat (limited to 'ext/standard/output.c')
-rw-r--r-- | ext/standard/output.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/ext/standard/output.c b/ext/standard/output.c index cacf045a0c..c29ef41900 100644 --- a/ext/standard/output.c +++ b/ext/standard/output.c @@ -61,22 +61,24 @@ static void php_output_init_globals(OLS_D) /* Start output layer */ -PHPAPI void php_output_startup() +PHPAPI void php_output_startup(void) { #ifdef ZTS output_globals_id = ts_allocate_id(sizeof(php_output_globals), (ts_allocate_ctor) php_output_init_globals, NULL); #else php_output_init_globals(OLS_C); #endif +} - { - OLS_FETCH(); - OG(php_body_write) = php_ub_body_write; - OG(php_header_write) = sapi_module.ub_write; - OG(nesting_level) = 0; - OG(lock) = 0; - } +PHPAPI void php_output_activate(void) +{ + OLS_FETCH(); + + OG(php_body_write) = php_ub_body_write; + OG(php_header_write) = sapi_module.ub_write; + OG(nesting_level) = 0; + OG(lock) = 0; } |