From 5eeaa3b5ca12b6c189c1f065b3fbe2877218d9a4 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Tue, 18 Nov 2008 16:00:14 +0000 Subject: [PATCH] [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 --- common/rfb/CMsgReader.cxx | 6 ++++++ 1 file changed, 6 insertions(+) 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]) { -- 2.39.5