summaryrefslogtreecommitdiff
path: root/main/output.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/output.c')
-rw-r--r--main/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/output.c b/main/output.c
index b197cb48b5..6880ada6a2 100644
--- a/main/output.c
+++ b/main/output.c
@@ -294,6 +294,9 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
OG(ob_nesting_level)--;
if (send_buffer) {
+ if (just_flush) { /* if flush is called prior to proper end, ensure presence of NUL */
+ final_buffer[final_buffer_length] = '\0';
+ }
OG(php_body_write)(final_buffer, final_buffer_length TSRMLS_CC);
}