diff options
| author | Antony Dovgal <tony2001@php.net> | 2006-06-26 23:22:45 +0000 |
|---|---|---|
| committer | Antony Dovgal <tony2001@php.net> | 2006-06-26 23:22:45 +0000 |
| commit | dfc2fd651c03d268b1e1530a9019e3dbe2c21588 (patch) | |
| tree | cec32095ab00f99f3edfc6b4005d124799025392 /ext/zlib/zlib.c | |
| parent | ffac3d3c1b8daa31aa35766694ea904e1e57416f (diff) | |
| download | php-git-dfc2fd651c03d268b1e1530a9019e3dbe2c21588.tar.gz | |
zero-terminate strings produced with FORCE_DEFLATE
Diffstat (limited to 'ext/zlib/zlib.c')
| -rw-r--r-- | ext/zlib/zlib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index e398c26a6e..089467018c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -817,6 +817,8 @@ PHP_FUNCTION(gzencode) trailer[6] = (char) (stream.total_in >> 16) & 0xFF; trailer[7] = (char) (stream.total_in >> 24) & 0xFF; trailer[8] = '\0'; + } else { + s2[stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0)] = '\0'; } RETURN_STRINGL(s2, stream.total_out + GZIP_HEADER_LENGTH + (coding == CODING_GZIP ? GZIP_FOOTER_LENGTH : 0), 0); } else { |
