From ebd1b4db1540670200f2a936161999672a64be02 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Fri, 21 Aug 2020 15:53:59 +0200 Subject: [PATCH] Hide base SConnection methods from VNCServerST It should be using the safe wrappers for everything so make sure it cannot bypass those and call the SConnection methods directly. --- common/rfb/VNCSConnectionST.h | 4 +++- common/rfb/VNCServerST.cxx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/rfb/VNCSConnectionST.h b/common/rfb/VNCSConnectionST.h index c8f4c24f..617e3c39 100644 --- a/common/rfb/VNCSConnectionST.h +++ b/common/rfb/VNCSConnectionST.h @@ -37,7 +37,7 @@ namespace rfb { class VNCServerST; - class VNCSConnectionST : public SConnection, + class VNCSConnectionST : private SConnection, public Timer::Callback { public: VNCSConnectionST(VNCServerST* server_, network::Socket* s, bool reverse); @@ -48,6 +48,8 @@ namespace rfb { virtual bool accessCheck(AccessRights ar) const; virtual void close(const char* reason); + using SConnection::authenticated; + // Methods called from VNCServerST. None of these methods ever knowingly // throw an exception. diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index f09715a4..17e963e8 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -599,7 +599,7 @@ SConnection* VNCServerST::getConnection(network::Socket* sock) { std::list::iterator ci; for (ci = clients.begin(); ci != clients.end(); ci++) { if ((*ci)->getSock() == sock) - return *ci; + return (SConnection*)*ci; } return 0; } -- 2.39.5