summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mannehed <samuel@cendio.se>2022-04-29 10:18:47 +0200
committerSamuel Mannehed <samuel@cendio.se>2022-04-29 11:11:59 +0200
commit3223f20d59f01c15a00d10580de7d0c0662a7484 (patch)
tree6d101d4b0b7588c5cf49af2608a21d91b763fdd7
parentccf759cb513867cdeddedb992a238e1fe89c063d (diff)
downloadtigervnc-3223f20d59f01c15a00d10580de7d0c0662a7484.tar.gz
tigervnc-3223f20d59f01c15a00d10580de7d0c0662a7484.zip
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.
-rw-r--r--common/rfb/SConnection.cxx3
1 files changed, 3 insertions, 0 deletions
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 <stdio.h>
#include <string.h>
+#include <assert.h>
#include <rfb/Exception.h>
#include <rfb/Security.h>
#include <rfb/clipboardTypes.h>
@@ -346,6 +347,8 @@ void SConnection::setAccessRights(AccessRights ar)
bool SConnection::accessCheck(AccessRights ar) const
{
+ assert(state_ >= RFBSTATE_QUERYING);
+
return (accessRights & ar) == ar;
}