From 10bbc389d50be796cafeea66562a5558f21d2a9f Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Fri, 2 Mar 2018 13:35:52 +0100 Subject: [PATCH 1/1] fix segfault if filter could not be located --- src/php_http_env_response.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/php_http_env_response.c b/src/php_http_env_response.c index ab959f3..40ef4fe 100644 --- a/src/php_http_env_response.c +++ b/src/php_http_env_response.c @@ -938,7 +938,9 @@ static ZEND_RESULT_CODE php_http_env_response_stream_start(php_http_env_response if (ctx->chunked) { ctx->chunked_filter = php_stream_filter_create("http.chunked_encode", NULL, 0); - php_stream_filter_append(&ctx->stream->writefilters, ctx->chunked_filter); + if (ctx->chunked_filter) { + php_stream_filter_append(&ctx->stream->writefilters, ctx->chunked_filter); + } } return ctx->started ? SUCCESS : FAILURE; -- 2.30.2