diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-09 18:14:41 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-09 18:14:41 (GMT) |
commit | 6d113b9a8521b15dfff6e38229f292b9ffb64d10 (patch) | |
tree | 6f106c680df77c045f8928ffdaf38da68413d957 /Source/CPack | |
parent | 75a47129025b0b1b8b543aa61feb3b24f438d3a4 (diff) | |
download | CMake-6d113b9a8521b15dfff6e38229f292b9ffb64d10.zip CMake-6d113b9a8521b15dfff6e38229f292b9ffb64d10.tar.gz CMake-6d113b9a8521b15dfff6e38229f292b9ffb64d10.tar.bz2 |
BUG: Fix memory problem
Diffstat (limited to 'Source/CPack')
-rw-r--r-- | Source/CPack/cmCPackTGZGenerator.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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<Bytef*>(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); |