From: Michael Wallner Date: Fri, 2 Mar 2018 12:35:52 +0000 (+0100) Subject: fix segfault if filter could not be located X-Git-Tag: RELEASE_3_2_0_RC1~11 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=10bbc389d50be796cafeea66562a5558f21d2a9f fix segfault if filter could not be located --- 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;