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 NULL dereferencing #20

Closed
wants to merge 1 commit into from

Conversation

trivialkettle
Copy link

Solves #19

@arobenko
Copy link
Member

arobenko commented Oct 7, 2024

The suggested fix is incorrect, the loop above has already found the right session object. However, when the posted function is executed, the sessions list is already modified and the iterator is pointing to an invalid memory. It's just by coincidence the suggested condition is evaluated to false. The proper approach would be erasing the found session object right away without posting. Due to the fact this that erasing happens to the different session object than the one invoking the callback, it should be safe to do it from within a callback.

@arobenko arobenko closed this Oct 7, 2024
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