]> source.dussan.org Git - tigervnc.git/commit
Make ZlibInStream more robust against failures
authorPierre Ossman <ossman@cendio.se>
Tue, 10 Sep 2019 09:05:48 +0000 (11:05 +0200)
committerPierre Ossman <ossman@cendio.se>
Fri, 20 Dec 2019 06:29:00 +0000 (07:29 +0100)
commit042de4642293df9b72a08189c249e2da79cbca91
treeb47d1863065c0824d52fcebf0b48aa37484cd9b8
parent8f77cf8ea28b5e3507b0dc9b27738115944f2567
Make ZlibInStream more robust against failures

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

(cherry picked from commit d61a767d6842b530ffb532ddd5a3d233119aad40)
common/rdr/ZlibInStream.cxx
common/rdr/ZlibInStream.h
common/rfb/CMsgReader.cxx
common/rfb/SMsgReader.cxx
common/rfb/TightDecoder.cxx
common/rfb/zrleDecode.h