Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix session count types #398

Merged
merged 1 commit into from
May 23, 2024
Merged

Fix session count types #398

merged 1 commit into from
May 23, 2024

Conversation

bith3ad
Copy link

@bith3ad bith3ad commented May 23, 2024

Description

Since commit f1e85af ("Session locking fixes") the session count variables are int. This is wrong since max_sessions is initialized by the token ulMaxSessionCount member so it of type CK_ULONG. Interpreting it as int is wrong since all values >= BIT(31) are interpreted as negative value.

Fix this by converting all session counting vars back to CK_ULONG.

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • This feature/change has adequate documentation added
  • Code conform to coding style that today cannot yet be enforced via the check style test
  • Commits have short titles and sensible commit messages
  • Coverity Scan has run if needed (code PR) and no new defects were found

Since commit f1e85af ("Session locking fixes") the session count
variables are int. This is wrong since max_sessions is initialized by
the token ulMaxSessionCount member so it of type CK_ULONG. Interpreting
it as int is wrong since all values >= BIT(31) are interpreted as
negative value.

Fix this by converting all session counting vars back to CK_ULONG.

Fixes: f1e85af ("Session locking fixes")
Signed-off-by: Marco Felsch <[email protected]>
@simo5 simo5 added bug Something isn't working covscan Triggers Coverity Scanner labels May 23, 2024
@github-actions github-actions bot removed the covscan Triggers Coverity Scanner label May 23, 2024
@simo5
Copy link
Member

simo5 commented May 23, 2024

The bind failure is a known fail, an unrelated.
The rest looks great, and coverity shows all clear.

Thanks for the contribution @bith3ad

@simo5 simo5 merged commit b6270a0 into latchset:main May 23, 2024
36 of 37 checks passed
@bith3ad bith3ad deleted the fix-session-count branch May 24, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants