From: Samuel Mannehed Date: Fri, 29 Apr 2022 08:18:47 +0000 (+0200) Subject: Assert that accessCheck isn't called too early X-Git-Tag: v1.12.90~36^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3223f20d59f01c15a00d10580de7d0c0662a7484;p=tigervnc.git 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. --- 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; }