Revision: 4942 http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4942&view=rev Author: ossman_ Date: 2012-07-19 11:06:27 +0000 (Thu, 19 Jul 2012) Log Message: ----------- Also check for negative encodings, in case the server is throwing unexpected garbage at us.
Modified Paths: -------------- trunk/common/rfb/CMsgReader.cxx trunk/common/rfb/Decoder.cxx Modified: trunk/common/rfb/CMsgReader.cxx =================================================================== --- trunk/common/rfb/CMsgReader.cxx 2012-07-19 08:40:48 UTC (rev 4941) +++ trunk/common/rfb/CMsgReader.cxx 2012-07-19 11:06:27 UTC (rev 4942) @@ -100,7 +100,7 @@ readCopyRect(r); } else { - if (encoding > encodingMax) { + if (!Decoder::supported(encoding)) { fprintf(stderr, "Unknown rect encoding %d\n", encoding); throw Exception("Unknown rect encoding"); } Modified: trunk/common/rfb/Decoder.cxx =================================================================== --- trunk/common/rfb/Decoder.cxx 2012-07-19 08:40:48 UTC (rev 4941) +++ trunk/common/rfb/Decoder.cxx 2012-07-19 11:06:27 UTC (rev 4942) @@ -34,12 +34,12 @@ bool Decoder::supported(int encoding) { - return encoding <= encodingMax && createFns[encoding]; + return encoding >= 0 && encoding <= encodingMax && createFns[encoding]; } Decoder* Decoder::createDecoder(int encoding, CMsgReader* reader) { - if (encoding <= encodingMax && createFns[encoding]) + if (supported(encoding)) return (*createFns[encoding])(reader); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Tigervnc-commits mailing list Tigervnc-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tigervnc-commits