Skip to content

Commit

Permalink
Assert that accessCheck isn't called too early
Browse files Browse the repository at this point in the history
These checks depend on accessRights being set up, this has only happened
if we have done the QUERYING steps.
  • Loading branch information
samhed committed Apr 29, 2022
1 parent ccf759c commit 3223f20
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions common/rfb/SConnection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -346,6 +347,8 @@ void SConnection::setAccessRights(AccessRights ar)

bool SConnection::accessCheck(AccessRights ar) const
{
assert(state_ >= RFBSTATE_QUERYING);

return (accessRights & ar) == ar;
}

Expand Down

0 comments on commit 3223f20

Please sign in to comment.