]> source.dussan.org Git - tigervnc.git/commitdiff
Assert that accessCheck isn't called too early 1463/head
authorSamuel Mannehed <samuel@cendio.se>
Fri, 29 Apr 2022 08:18:47 +0000 (10:18 +0200)
committerSamuel Mannehed <samuel@cendio.se>
Fri, 29 Apr 2022 09:11:59 +0000 (11:11 +0200)
These checks depend on accessRights being set up, this has only happened
if we have done the QUERYING steps.

common/rfb/SConnection.cxx

index d7633d26041534532522c802925ef6b27791a0b5..f70d21dced7478b24f371081d91c1d6754047aad 100644 (file)
@@ -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;
 }