From 6d113b9a8521b15dfff6e38229f292b9ffb64d10 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Mon, 9 Jan 2006 13:14:41 -0500 Subject: BUG: Fix memory problem --- Source/CPack/cmCPackTGZGenerator.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index d9bed2b..efdbdd4 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -116,6 +116,7 @@ ssize_t cmCPackTGZ_Data_Write(void *client_data, void *buff, size_t n) { cmCPackTGZ_Data *mydata = (cmCPackTGZ_Data*)client_data; + mydata->m_ZLibStream.avail_in = n; mydata->m_ZLibStream.next_in = reinterpret_cast(buff); @@ -240,7 +241,7 @@ int cmCPackTGZGenerator::CompressFiles(const char* outFileName, const char* topl int cmCPackTGZGenerator::GenerateHeader(std::ostream* os) { const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - char header[10]; + char header[11]; sprintf(header, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); os->write(header, 10); -- cgit v0.12