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 segmenatation fault if connection is closed during handshake #399

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

BewareMyPower
Copy link
Contributor

Fixes #398

Motivation

There is an implicit requirement for the async_handshake API that before it's done, the socket and ssl::stream objects must exist. Otherwise segmenatation fault might happen.

Modifications

Capture socket_ and tlsSocket_ in the handshake callback. It can be verified by modifying the code according to #398 and rerun the test.

@BewareMyPower BewareMyPower added this to the 3.5.0 milestone Feb 6, 2024
@BewareMyPower BewareMyPower self-assigned this Feb 6, 2024
@BewareMyPower BewareMyPower added the bug Something isn't working label Feb 6, 2024
@BewareMyPower
Copy link
Contributor Author

Wait for #400 to be merged

Fixes apache#398

### Motivation

There is an implicit requirement for the `async_handshake` API that
before it's done, the `socket` and `ssl::stream` objects must exist.
Otherwise segmenatation fault might happen.

### Modifications

Capture `socket_` and `tlsSocket_` in the handshake callback. It can be
verified by modifying the code according to apache#398 and rerun the test.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-handshake branch from 17cc4c3 to 0550445 Compare February 6, 2024 14:17
@merlimat merlimat merged commit 71077b8 into apache:main Feb 6, 2024
12 checks passed
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-handshake branch February 7, 2024 02:27
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.

[Bug] Segmentation fault might happen during handshake if closed
2 participants