Permalink
Browse files

fix compat function not passing along input buffer with php_output_co…

…ntext_pass() if the output_handler_func does not set out_str
  • Loading branch information...
1 parent 4d600bd commit 7a58d9f6794d6786891f83bfb32ecfca7161d6dd @m6w6 m6w6 committed Feb 14, 2012
Showing with 12 additions and 4 deletions.
  1. +12 −4 main/output.c
View
@@ -1260,11 +1260,19 @@ static int php_output_handler_compat_func(void **handler_context, php_output_con
PHP_OUTPUT_TSRMLS(output_context);
if (func) {
- uint safe_out_len;
+ char *out_str = NULL;
+ uint out_len = 0;
+
+ func(output_context->in.data, output_context->in.used, &out_str, &out_len, output_context->op TSRMLS_CC);
+
+ if (out_str) {
+ output_context->out.data = out_str;
+ output_context->out.used = out_len;
+ output_context->out.free = 1;
+ } else {
+ php_output_context_pass(output_context);
+ }
- func(output_context->in.data, output_context->in.used, &output_context->out.data, &safe_out_len, output_context->op TSRMLS_CC);
- output_context->out.used = safe_out_len;
- output_context->out.free = 1;
return SUCCESS;
}
return FAILURE;

0 comments on commit 7a58d9f

Please sign in to comment.