diff options
author | Pierre Ossman <ossman@cendio.se> | 2015-03-03 16:17:51 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2015-03-03 16:17:51 +0100 |
commit | a7bbe9c4a3b2090240173e45bebab86e5cba3b4b (patch) | |
tree | 0bdba695d5126806843d24245ff20b3b16f3a27a /common/rfb/CConnection.cxx | |
parent | 5b3c5f49b103d45ce11cd7c0319c82b95ee61e58 (diff) | |
download | tigervnc-a7bbe9c4a3b2090240173e45bebab86e5cba3b4b.tar.gz tigervnc-a7bbe9c4a3b2090240173e45bebab86e5cba3b4b.zip |
Make sure Exceptions do not use unsafe format strings
Diffstat (limited to 'common/rfb/CConnection.cxx')
-rw-r--r-- | common/rfb/CConnection.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/common/rfb/CConnection.cxx b/common/rfb/CConnection.cxx index e0a23b5a..8ccd948b 100644 --- a/common/rfb/CConnection.cxx +++ b/common/rfb/CConnection.cxx @@ -97,12 +97,11 @@ void CConnection::processVersionMsg() // The only official RFB protocol versions are currently 3.3, 3.7 and 3.8 if (cp.beforeVersion(3,3)) { - char msg[256]; - sprintf(msg,"Server gave unsupported RFB protocol version %d.%d", - cp.majorVersion, cp.minorVersion); - vlog.error("%s", msg); + vlog.error("Server gave unsupported RFB protocol version %d.%d", + cp.majorVersion, cp.minorVersion); state_ = RFBSTATE_INVALID; - throw Exception(msg); + throw Exception("Server gave unsupported RFB protocol version %d.%d", + cp.majorVersion, cp.minorVersion); } else if (useProtocol3_3 || cp.beforeVersion(3,7)) { cp.setVersion(3,3); } else if (cp.afterVersion(3,8)) { |