zero-terminate strings produced with FORCE_DEFLATE

This commit is contained in:
Antony Dovgal 2006-06-26 23:22:45 +00:00
parent ffac3d3c1b
commit dfc2fd651c

View File

@ -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 {