]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorMichael Wallner <mike@php.net>
Wed, 18 Feb 2015 13:04:19 +0000 (14:04 +0100)
committerMichael Wallner <mike@php.net>
Wed, 18 Feb 2015 13:04:19 +0000 (14:04 +0100)
* PHP-5.6:
  Fixed bug #65593 (Segfault when calling ob_start from output buffering callback)

1  2 
main/output.c

diff --cc main/output.c
index 2991d0dba108005f0e054ef8e8a3e1147bbed545,456241f4e94e12dd1d48d18f51e690152d35ac28..64729ac4a49c23a566c5fc0a52a48f4782fd65d3
@@@ -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));
        }
  }
  /* }}} */