]> granicus.if.org Git - php/commitdiff
fix #32828 (Throwing exception in output_callback function with ob_start and
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Apr 2005 14:20:28 +0000 (14:20 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Apr 2005 14:20:28 +0000 (14:20 +0000)
ob_end_clean leads to segfault)

main/output.c

index 14303fd9f6005cb000fec67c79f03e434bbc40dd..3214d00a7ca0e14b306774b3808b852e127acb9e 100644 (file)
@@ -238,7 +238,7 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
                OG(ob_lock) = 1;
 
                if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler, &alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) {
-                       if (!(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) {
+                       if (alternate_buffer && !(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) {
                                convert_to_string_ex(&alternate_buffer);
                                final_buffer = Z_STRVAL_P(alternate_buffer);
                                final_buffer_length = Z_STRLEN_P(alternate_buffer);