summaryrefslogtreecommitdiff
path: root/ext/zlib
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2006-06-26 23:22:58 +0000
committerAntony Dovgal <tony2001@php.net>2006-06-26 23:22:58 +0000
commite24fe395a2118efbb5456e5cce75988e4739d3bb (patch)
tree4d687281b712a532f3f624cf34484c2c16b96c6a /ext/zlib
parent3d97f45bc43ff0a9c6e40a4f08f5283866fa6a92 (diff)
downloadphp-git-e24fe395a2118efbb5456e5cce75988e4739d3bb.tar.gz
MFH: zero-terminate strings produced with FORCE_DEFLATE
Diffstat (limited to 'ext/zlib')
-rw-r--r--ext/zlib/zlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index d3932f41ad..e9bea6cf0f 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -820,6 +820,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 {