From cb95dde1e42569130d163be3f339fdeb08e63214 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 21 Jan 2004 14:06:44 -0500 Subject: [PATCH] BUG: Fixed buffer size in MakeXMLSafe. --- Source/cmCTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index beceb4129..5cc0728b8 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -208,7 +208,6 @@ static const char* cmCTestMemCheckResultStrings[] = { std::string cmCTest::MakeXMLSafe(const std::string& str) { cmOStringStream ost; - char buffer[10]; // By uncommenting the lcnt code, it will put newline every 120 characters //int lcnt = 0; for (std::string::size_type pos = 0; pos < str.size(); pos ++ ) @@ -216,6 +215,7 @@ std::string cmCTest::MakeXMLSafe(const std::string& str) unsigned char ch = str[pos]; if ( (ch > 126 || ch < 32) && ch != 9 && ch != 10 && ch != 13 ) { + char buffer[33]; sprintf(buffer, "<%d>", (int)ch); //sprintf(buffer, "&#x%0x;", (unsigned int)ch); ost << buffer;