From: Michael Wallner Date: Wed, 12 Dec 2012 11:42:34 +0000 (+0000) Subject: fiy segv with null pointer string on flush X-Git-Tag: RELEASE_2_1_0_RC3~10^2^2~82 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=b4d3e570d0dfac8421235d8f967a92e0c4c3657e;p=m6w6%2Fext-http fiy segv with null pointer string on flush --- diff --git a/php_http_encoding.c b/php_http_encoding.c index 4a71c80..a1667fc 100644 --- a/php_http_encoding.c +++ b/php_http_encoding.c @@ -1061,7 +1061,11 @@ PHP_METHOD(HttpEncodingStream, flush) size_t encoded_len; if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len)) { - RETURN_STRINGL(encoded_str, encoded_len, 0); + if (encoded_str) { + RETURN_STRINGL(encoded_str, encoded_len, 0); + } else { + RETURN_EMPTY_STRING(); + } } } }