- avoid warning in http_encoding_inflate_stream_finish()
authorMichael Wallner <mike@php.net>
Sat, 20 May 2006 15:31:44 +0000 (15:31 +0000)
committerMichael Wallner <mike@php.net>
Sat, 20 May 2006 15:31:44 +0000 (15:31 +0000)
  if there's nothing left to inflate

http_encoding_api.c

index 178c9925a34de64e760fa1aec9f715edef816c9c..28f6a9d0daf3d82003baf9997cca67bad159bf51 100644 (file)
@@ -571,6 +571,12 @@ PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s
 {
        int status;
        
+       if (!PHPSTR_LEN(s->stream.opaque)) {
+               *decoded = NULL;
+               *decoded_len = 0;
+               return SUCCESS;
+       }
+       
        *decoded_len = (PHPSTR_LEN(s->stream.opaque) + 1) * HTTP_INFLATE_ROUNDS;
        *decoded = emalloc_rel(*decoded_len);