From 3223f20d59f01c15a00d10580de7d0c0662a7484 Mon Sep 17 00:00:00 2001 From: Samuel Mannehed Date: Fri, 29 Apr 2022 10:18:47 +0200 Subject: [PATCH] Assert that accessCheck isn't called too early These checks depend on accessRights being set up, this has only happened if we have done the QUERYING steps. --- common/rfb/SConnection.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/rfb/SConnection.cxx b/common/rfb/SConnection.cxx index d7633d26..f70d21dc 100644 --- a/common/rfb/SConnection.cxx +++ b/common/rfb/SConnection.cxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -346,6 +347,8 @@ void SConnection::setAccessRights(AccessRights ar) bool SConnection::accessCheck(AccessRights ar) const { + assert(state_ >= RFBSTATE_QUERYING); + return (accessRights & ar) == ar; } -- 2.39.5