fiy segv with null pointer string on flush
authorMichael Wallner <mike@php.net>
Wed, 12 Dec 2012 11:42:34 +0000 (11:42 +0000)
committerMichael Wallner <mike@php.net>
Wed, 12 Dec 2012 11:42:34 +0000 (11:42 +0000)
php_http_encoding.c

index 4a71c80074d24f1ea902a641df09810c13653312..a1667fc0fdc645be68540c69cf75fc670ccdb40e 100644 (file)
@@ -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();
+                               }
                        }
                }
        }