]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Backported patch from RealVNC 4.1.3. FYI it is not security related.
authorAdam Tkac <atkac@redhat.com>
Tue, 18 Nov 2008 16:00:14 +0000 (16:00 +0000)
committerAdam Tkac <atkac@redhat.com>
Tue, 18 Nov 2008 16:00:14 +0000 (16:00 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3183 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/CMsgReader.cxx

index 38547c0f437b858f6014474a8b11c0fff58f53af..cc288462a9b9427e5ca00171b320082c3f782608 100644 (file)
@@ -99,6 +99,12 @@ void CMsgReader::readRect(const Rect& r, unsigned int encoding)
   if (encoding == encodingCopyRect) {
     readCopyRect(r);
   } else {
+
+    if (encoding > encodingMax) {
+      fprintf(stderr, "Unknown rect encoding %d\n", encoding);
+      throw Exception("Unknown rect encoding");
+    }
+
     if (!decoders[encoding]) {
       decoders[encoding] = Decoder::createDecoder(encoding, this);
       if (!decoders[encoding]) {