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: ios sockets segfault on connect timeout #3760

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

shannah
Copy link
Collaborator

@shannah shannah commented Nov 6, 2023

Untested.

I believe this fixes a segfault that occurs if an iOS socket times out on connection.

The problem is that on timeout, it "disconnects" which sets the inputStream and outputStream to null, but on the thread that calls connect(), it is blocking on the [inputStream open] call until this disconnect happens. The disconnect removes the logjam, so that it proceeds to the next line, where it tries to call [outputStream] open, but by this time outputStream was set to nil by the disconnect.

This fix just guards against calling methods on a nil reference.

@shai-almog shai-almog merged commit 9425b19 into master Nov 7, 2023
1 check 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