From: Adam Tkac Date: Tue, 18 Nov 2008 16:00:14 +0000 (+0000) Subject: [Bugfix] Backported patch from RealVNC 4.1.3. FYI it is not security related. X-Git-Tag: v0.0.90~364 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5eeaa3b5ca12b6c189c1f065b3fbe2877218d9a4;p=tigervnc.git [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 --- 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]) {