Fix unsafe usage of the logging functions.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4905 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx
index f2f19ca..e73b02e 100644
--- a/common/rfb/CConnection.cxx
+++ b/common/rfb/CConnection.cxx
@@ -100,7 +100,7 @@
char msg[256];
sprintf(msg,"Server gave unsupported RFB protocol version %d.%d",
cp.majorVersion, cp.minorVersion);
- vlog.error(msg);
+ vlog.error("%s", msg);
state_ = RFBSTATE_INVALID;
throw Exception(msg);
} else if (useProtocol3_3 || cp.beforeVersion(3,7)) {
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx
index 3421de5..6b6b017 100644
--- a/common/rfb/CSecurityTLS.cxx
+++ b/common/rfb/CSecurityTLS.cxx
@@ -72,7 +72,7 @@
static void debug_log(int level, const char* str)
{
- vlog_raw.debug(str);
+ vlog_raw.debug("[%d]: %s", level, str);
}
void CSecurityTLS::initGlobal()
diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx
index 941d30a..ee57336 100644
--- a/common/rfb/SConnection.cxx
+++ b/common/rfb/SConnection.cxx
@@ -239,7 +239,7 @@
void SConnection::throwConnFailedException(const char* msg)
{
- vlog.info(msg);
+ vlog.info("%s", msg);
if (state_ == RFBSTATE_PROTOCOL_VERSION) {
if (cp.majorVersion == 3 && cp.minorVersion == 3) {
os->writeU32(0);
diff --git a/common/rfb/SSecurityTLS.cxx b/common/rfb/SSecurityTLS.cxx
index 2ea84e0..9a34f3a 100644
--- a/common/rfb/SSecurityTLS.cxx
+++ b/common/rfb/SSecurityTLS.cxx
@@ -49,7 +49,7 @@
static void debug_log(int level, const char* str)
{
- vlog.debug(str);
+ vlog.debug("[%d]: %s", level, str);
}
void SSecurityTLS::initGlobal()