aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CMsgReader.cxx
Commit message (Collapse)AuthorAgeFilesLines
* Stop supplying flags to clipboard peek handlerPierre Ossman2023-01-041-1/+1
| | | | The flags should always be empty anyway.
* Safely discard large (extended) clipboard contentsPierre Ossman2022-06-281-4/+20
| | | | | | | | | Avoid having to buffer everything we want to discard, and instead do it piece by piece. This is more efficient, and avoids hitting any limits on the buffering. Note that this is safe here because we already know we have all the compressed data. It would not be safe for a general input stream.
* Fix handling of VMware cursorsPierre Ossman2022-01-181-2/+2
| | | | | | This is a regression from ad0f061. If a VMware cursor rect was split up over multiple read()s then the stream would become corrupted as we set the restore point at the wrong place.
* Be consistent in including config.hPierre Ossman2021-12-301-0/+4
| | | | | | The generally recommended way is to include it from source files, not headers. We had a mix of both. Let's try to be consistent and follow the recommended way.
* Support the VMware Cursor Position extension on vncviewerlhchavez2021-03-111-0/+4
| | | | | | | | This change makes it possible for re-synchronizing the remote cursor on the vncviewer when in fullscreen mode. This is done by locally moving the cursor position to what the server thinks it should be. Now SDL games should work!
* Fix some incorrect data waitsPierre Ossman2021-03-021-7/+7
| | | | | | | | Some of these were incorrectly calculated so the server or client would wait too long before proceeding with decoding. Change all of these to be a more explicit calculation to avoid such issues in the future.
* Change streams to be asynchronousPierre Ossman2020-05-211-63/+262
| | | | | | | | | | Major restructuring of how streams work. Neither input nor output streams are now blocking. This avoids stalling the rest of the client or server when a peer is slow or unresponsive. Note that this puts an extra burden on users of streams to make sure they are allowed to do their work once the underlying transports are ready (e.g. monitoring fds).
* Remove readString()/writeString()Pierre Ossman2020-05-211-5/+9
| | | | | These are not universal in the protocol so having functions for them only obfuscates things.
* Make ZlibInStream more robust against failuresPierre Ossman2019-11-151-1/+2
| | | | | | | | | | | | Move the checks around to avoid missing cases where we might access memory that is no longer valid. Also avoid touching the underlying stream implicitly (e.g. via the destructor) as it might also no longer be valid. A malicious server could theoretically use this for remote code execution in the client. Issue found by Pavel Cheremushkin from Kaspersky Lab
* Support extended clipboard transfersPierre Ossman2019-07-011-3/+109
| | | | | | | Implements support in both client and server for the extended clipboard format first seen in UltraVNC. Currently only implements text handling, but that is still an improvement as it extends the clipboard from ISO 8859-1 to full Unicode.
* Clean up internal clipboard handlingPierre Ossman2019-07-011-1/+1
| | | | | | We now filter incoming data, which means we can start assuming the clipboard data is always null terminated. This allows us to clean up a lot of the internal handling.
* Make sure clipboard uses \n line endingsPierre Ossman2019-07-011-3/+3
| | | | | | This is required by the protocol so we should make sure it is enforced. We are tolerant of clients that violate this though and convert incoming clipboard data.
* Do proper logging rather than fprintf(stderr, ...)Pierre Ossman2019-04-291-6/+9
|
* Merge branch 'vmware' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-101-0/+107
|\
| * Add support for VMware LED statusPierre Ossman2018-12-101-0/+16
| |
| * Add support for VMware cursorsPierre Ossman2018-12-101-0/+91
| |
* | Merge branch 'connparams' of https://github.com/CendioOssman/tigervncPierre Ossman2018-12-101-12/+10
|\|
| * Let CMsgHandler::serverInit() handle initial set upPierre Ossman2018-11-011-4/+1
| | | | | | | | | | | | | | Avoid using the callbacks used for runtime changes for the initial setup. They weren't really useful anyway as you could not allocate a framebuffer without also knowing the pixel format. So make things more clear by letting serverInit() get the initial settings.
| * Split out ServerParams from ConnParamsPierre Ossman2018-11-011-8/+9
| | | | | | | | | | | | We need to track different things in the server and client, so separate things to two independent structures to keep things more clear.
| * Encapsulate screen layout storage in ConnParamsPierre Ossman2018-11-011-2/+2
| | | | | | | | | | | | | | Avoid direct access to the screen dimensions and layout so that we can make sure it stays sane. This also makes sure the layout is properly updated when we only get the screen dimensions from the server.
* | Remove variable length arraysPierre Ossman2018-11-071-6/+6
|/ | | | | These are not allowed in C++, and have been made optional in C11. So let's just get rid of them and any issues they may cause.
* Avoid compiler "use of uninitialised variable" warningsPierre Ossman2018-09-131-32/+33
| | | | | The compiler isn't smart enough to figure all of these out, so restructure things a bit to avoid warnings.
* Fix "int-in-bool-context" compile errorsBrian P. Hinz2017-11-161-1/+1
|
* Keep alpha in cursor alpha conversionPierre Ossman2017-10-021-1/+0
| | | | | Don't touch the existing value or we might mess it up when we avoid division by zero.
* Basic support for QEMU Extended Key EventsPierre Ossman2017-08-281-0/+2
| | | | | | This adds the basic infrastructure and handshake for the QEMU Extended Key Events extension. No viewer or server makes use of the extra functionality yet though.
* Add client support for LED state syncPierre Ossman2017-08-241-0/+12
|
* Limit size of cursor accepted by client.Michal Srb2017-04-061-0/+9
| | | | | | | | | Width and height of a cursor are received as U16 from network. Accepting full range of U16 values can cause integer overflows in multiple places. The worst is probably VLA in CMsgReader::readSetXCursor: rdr::U8 buf[width*height*4]; The width*height*4 can be too big to fit on stack or it can overflow into negative numbers. Both cases are undefined behaviour. Following writes to buf can overwrite other data on stack.
* Client support for cursors with full alphaPierre Ossman2017-02-221-0/+50
|
* Client support for X CursorPierre Ossman2017-02-221-0/+58
|
* Change cursor API to use RGBA dataPierre Ossman2017-02-221-2/+27
| | | | | This will allow us to use better formats that preserve the entire alpha channel.
* Remove CMsgReader::getImageBuf() as nothing uses itPierre Ossman2015-11-271-23/+1
|
* Encoders/decoders should track the connection objectPierre Ossman2014-07-071-5/+0
| | | | | | The connection object is a much more appropriate object for the decoders and encoders to keep track of. Besides the streams, it also contains state like connection parameters.
* Push encoder and decoder handling down into the connection objectsPierre Ossman2014-07-071-23/+1
| | | | | This keeps the reader and writer objects clean and simple protocol decoders/encoders.
* Handle CopyRect like any other encodingPierre Ossman2014-07-071-20/+8
| | | | Avoids having to special case things. Keeps the code simpler.
* Merge the "V3" message classes into the normal onesPierre Ossman2014-07-071-5/+144
| | | | We have no need for this abstraction so let's keep things simple.
* Also check for negative encodings, in case the server is throwing unexpectedPierre Ossman2012-07-191-1/+1
| | | | | | | garbage at us. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4942 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Eliminate GCC signed/unsigned warnings related to encodings: ThePeter Åstrand2010-02-101-3/+3
| | | | | | | | | | | | encoding in the RFB protocol has always been signed, and signed values are also used in the specification (ie DesktopName = -307 etc). In the code, however, unsigned types were used in a number of places, but not all, which causes warnings. This patch fixes the problem by switching to signed values everywhere. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3968 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Move the SetDesktopName parser into CMsgReaderV3 to keep with the separationPierre Ossman2009-03-201-13/+0
| | | | | | | of old and new features. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3696 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Bugfix] Use rdr::U32 type for length of strings handled by *CutText functions.Adam Tkac2009-02-131-1/+1
| | | | | | | This avoids big buffer overflow when memcpy is called with "-1" argument. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3607 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Implemented support for DesktopName pseudo encoding, which allowsPeter Åstrand2009-01-151-0/+13
| | | | | | | | | | updating the desktop name on the fly. Tested in ThinLinc since 2008-01-07. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3549 3789f03b-4d11-0410-bbf8-ca57d06f2519
* [Bugfix] Backported patch from RealVNC 4.1.3. FYI it is not security related.Adam Tkac2008-11-181-0/+6
| | | | git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3183 3789f03b-4d11-0410-bbf8-ca57d06f2519
* Migrating to new directory structure adopted from the RealVNC's source tree. ↵Constantin Kaplinsky2006-05-251-0/+158
More changes will follow. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@589 3789f03b-4d11-0410-bbf8-ca57d06f2519