From: Pierre Ossman Date: Wed, 24 Aug 2022 14:10:36 +0000 (+0200) Subject: Fix stream check for InStream::getptr() X-Git-Tag: v1.12.90~19^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F1522%2Fhead;p=tigervnc.git Fix stream check for InStream::getptr() This call should have been preceeded by hasData() or avail(), just like all other accessor functions. --- diff --git a/common/rdr/InStream.h b/common/rdr/InStream.h index c02e967f..26817fb8 100644 --- a/common/rdr/InStream.h +++ b/common/rdr/InStream.h @@ -166,9 +166,6 @@ namespace rdr { // some other stream API. inline const U8* getptr(size_t length) { check(length); -#ifdef RFB_INSTREAM_CHECK - checkedBytes += length; -#endif return ptr; } inline void setptr(size_t length) { if (length > avail()) throw Exception("Input stream overflow");