From: Michael Wallner Date: Wed, 18 Feb 2015 13:04:19 +0000 (+0100) Subject: Merge branch 'PHP-5.6' X-Git-Tag: PRE_PHP7_EREG_MYSQL_REMOVALS~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b36581aa75ef671b53189bc05fbf791d0e437253;p=php Merge branch 'PHP-5.6' * PHP-5.6: Fixed bug #65593 (Segfault when calling ob_start from output buffering callback) --- b36581aa75ef671b53189bc05fbf791d0e437253 diff --cc main/output.c index 2991d0dba1,456241f4e9..64729ac4a4 --- a/main/output.c +++ b/main/output.c @@@ -179,21 -172,22 +179,21 @@@ PHPAPI void php_output_deactivate(void { php_output_handler **handler = NULL; - php_output_header(); + 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 ((handler = zend_stack_top(&OG(handlers)))) { - php_output_handler_free(handler); - 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); ++ while ((handler = zend_stack_top(&OG(handlers)))) { ++ php_output_handler_free(handler); + zend_stack_del_top(&OG(handlers)); + } - zend_stack_destroy(&OG(handlers)); } + zend_stack_destroy(&OG(handlers)); } - } /* }}} */