mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5: Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)
This commit is contained in:
commit
0d2a2b98c9
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
13
tests/output/bug65593.phpt
Normal file
13
tests/output/bug65593.phpt
Normal file
@ -0,0 +1,13 @@
|
||||
--TEST--
|
||||
Bug #65593 (ob_start(function(){ob_start();});)
|
||||
--FILE--
|
||||
<?php
|
||||
echo "Test\n";
|
||||
|
||||
ob_start(function(){ob_start();});
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Test
|
||||
|
||||
Fatal error: Cannot destroy active lambda function in /home/mike/src/php-5.5/tests/output/bug65593.php on line 4
|
Loading…
Reference in New Issue
Block a user