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

Prevent SV_DropClient() from being called recursively #693

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

smallmodel
Copy link

@smallmodel smallmodel commented Oct 11, 2024

This fixes an issue where SV_DropClient() would get called twice on the same client if the later gets kicked and has too many reliable commands right while sending a server command in SV_DropClient().
For example when kicking a client, SV_DropClient() gets called and sends server commands (print + disconnect). If the kicked client has too many reliable commands, SV_AddServerCommand() would call SV_DropClient() again on the same client.

This bug can occur as follow:

  • SV_CheckTimeouts() is called
    • SV_DropClient() gets called on a client that timed out
      • SV_SendServerCommand() gets called to print stuff
        • SV_AddServerCommand() is called on the client being dropped
          • SV_DropClient() is called because it's exactly the 513th command
            • Print stuff, call VM stuff, send "disconnect", reset the user info...
      • Call VM stuff, send "disconnect", reset the user info...

…s dropped by a kick or timeout and has too many reliable commands
@timangus
Copy link
Member

Good catch.

@timangus timangus merged commit cc18246 into ioquake:main Oct 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants