summaryrefslogtreecommitdiff
path: root/main/output.c
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2015-02-18 13:58:31 +0100
committerMichael Wallner <mike@php.net>2015-02-18 13:58:31 +0100
commit225af964c0324b2bf14e44c0fad77198b97cc06c (patch)
treef53bd4d9b223270b9d05c6ab0aaf06bf8ea2c3f6 /main/output.c
parent73c2e9153a7bee878c4d57d3dbc439edcd717ce9 (diff)
downloadphp-git-225af964c0324b2bf14e44c0fad77198b97cc06c.tar.gz
Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
Diffstat (limited to 'main/output.c')
-rw-r--r--main/output.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/main/output.c b/main/output.c
index f9b8a68a80..bb0f6bd680 100644
--- a/main/output.c
+++ b/main/output.c
@@ -172,21 +172,22 @@ PHPAPI void php_output_deactivate(TSRMLS_D)
{
php_output_handler **handler = NULL;
- php_output_header(TSRMLS_C);
+ if ((OG(flags) & PHP_OUTPUT_ACTIVATED)) {
+ php_output_header(TSRMLS_C);
- OG(flags) ^= PHP_OUTPUT_ACTIVATED;
- OG(active) = NULL;
- OG(running) = NULL;
+ OG(flags) ^= PHP_OUTPUT_ACTIVATED;
+ OG(active) = NULL;
+ OG(running) = NULL;
- /* release all output handlers */
- if (OG(handlers).elements) {
- while (SUCCESS == zend_stack_top(&OG(handlers), (void *) &handler)) {
- php_output_handler_free(handler TSRMLS_CC);
- zend_stack_del_top(&OG(handlers));
+ /* release all output handlers */
+ if (OG(handlers).elements) {
+ while (SUCCESS == zend_stack_top(&OG(handlers), (void *) &handler)) {
+ php_output_handler_free(handler TSRMLS_CC);
+ zend_stack_del_top(&OG(handlers));
+ }
+ zend_stack_destroy(&OG(handlers));
}
- zend_stack_destroy(&OG(handlers));
}
-
}
/* }}} */