]> granicus.if.org Git - php/commitdiff
Resolved bug #34240.
authorIlia Alshanetsky <iliaa@php.net>
Fri, 2 Sep 2005 17:25:10 +0000 (17:25 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 2 Sep 2005 17:25:10 +0000 (17:25 +0000)
# Thanks to xuefer at 21cn dot com for providing it.

ext/zlib/zlib.c

index ff68743ccd74a0649623dfc20ef79e7107371017..20f2258c5c63adff41b5e5d4cb380ae4fc1a7153 100644 (file)
@@ -644,7 +644,7 @@ static int php_do_deflate(uint str_length, Bytef **p_buffer, uint *p_buffer_len,
 
        if (do_end) {
                err = deflate(&ZLIBG(stream), Z_FINISH);
-               buffer[outlen - ZLIBG(stream).avail_out] = '\0';
+               buffer[outlen + start_offset - ZLIBG(stream).avail_out] = '\0';
        }
 
        *p_buffer = buffer;