openbsd-ports/devel/cmake/patches/patch-Source_CPack_cmCPackTGZGenerator_cxx

13 lines
724 B
Plaintext

$OpenBSD: patch-Source_CPack_cmCPackTGZGenerator_cxx,v 1.4 2008/01/26 21:26:32 espie Exp $
--- Source/CPack/cmCPackTGZGenerator.cxx.orig Mon Jan 21 19:59:53 2008
+++ Source/CPack/cmCPackTGZGenerator.cxx Sat Jan 26 20:47:17 2008
@@ -287,7 +287,7 @@ int cmCPackTGZGenerator::GenerateHeader(std::ostream*
{
const int gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */
char header[11];
- sprintf(header, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1],
+ snprintf(header, sizeof 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*/,
3 /* zlib os code for UNIX, not really used anyway */);
os->write(header, 10);