diff options
author | Adam Tkac <atkac@redhat.com> | 2008-11-18 16:00:14 +0000 |
---|---|---|
committer | Adam Tkac <atkac@redhat.com> | 2008-11-18 16:00:14 +0000 |
commit | 5eeaa3b5ca12b6c189c1f065b3fbe2877218d9a4 (patch) | |
tree | 0997a910e95fba8b53e5dc2e2582b47f1b371eae /common/rfb/CMsgReader.cxx | |
parent | 9cb6a4259975fbd21112a4dffdaef47d23ff9f26 (diff) | |
download | tigervnc-5eeaa3b5ca12b6c189c1f065b3fbe2877218d9a4.tar.gz tigervnc-5eeaa3b5ca12b6c189c1f065b3fbe2877218d9a4.zip |
[Bugfix] Backported patch from RealVNC 4.1.3. FYI it is not security related.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3183 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/CMsgReader.cxx')
-rw-r--r-- | common/rfb/CMsgReader.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/rfb/CMsgReader.cxx b/common/rfb/CMsgReader.cxx index 38547c0f..cc288462 100644 --- a/common/rfb/CMsgReader.cxx +++ b/common/rfb/CMsgReader.cxx @@ -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]) { |