Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prevent loops during disconnect #2031

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

Merged
merged 1 commit into from
Aug 19, 2024
Merged

Conversation

rposky
Copy link
Contributor

@rposky rposky commented Aug 14, 2024

This attempts to address #2030 where it was reported the potential to enter an infinite loop while disconnecting, seemingly due to an absent check for a closed/eof socket prior to issuing a final DISCONNECT message. This change prevents sending said DISCONNECT message on a closed socket, and also adds further protection for looping for other possible error paths.

… disconnecting. Do not attempt disconnect packet send on closed socket.
@terrafrost
Copy link
Member

Looks good to me! I'll merge it this weekend - thanks!

@terrafrost terrafrost merged commit dd2d866 into phpseclib:3.0 Aug 19, 2024
36 of 37 checks passed
@ivan-wolf
Copy link

ivan-wolf commented Sep 10, 2024

We've also hit this problem.
Thanks for solving it, @terrafrost and @rposky 🙌

Can you say when a new release is to be expected?

@terrafrost
Copy link
Member

terrafrost commented Sep 10, 2024 via email

@terrafrost
Copy link
Member

3.0.42 has been released:

https://github.com/phpseclib/phpseclib/releases/tag/3.0.42

@ivan-wolf
Copy link

Thanks a lot, @terrafrost!

I can confirm that the change fixed our problem 👍

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.

3 participants