- no fatal ereallocs please
[m6w6/ext-http] / http_encoding_api.c
index 32072641204426fc5724ea5a7f410d37c7c71248..c0d1140d4d452f5e0d304caea652959836709c1d 100644 (file)
@@ -479,7 +479,7 @@ PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s,
        {
                case Z_OK:
                case Z_STREAM_END:
-                       *encoded_len = 0x800 - s->stream.avail_out;
+                       *encoded_len = 0x8000 - s->stream.avail_out;
                        *encoded = erealloc_rel(*encoded, *encoded_len + 1);
                        (*encoded)[*encoded_len] = '\0';
                        return SUCCESS;
@@ -538,7 +538,7 @@ PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s
 {
        int status;
        
-       *decoded_len = s->stream.avail_in << 2;
+       *decoded_len = PHPSTR_LEN(s->stream.opaque) << 2;
        *decoded = emalloc_rel(*decoded_len);
        
        /* inflate remaining input */