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 unhandled null pointer returning from os_addrinfo_intern #3687

Merged
merged 2 commits into from
Dec 26, 2020

Conversation

ergl
Copy link
Member

@ergl ergl commented Dec 19, 2020

os_socket_listen, os_socket_connect and os_connect incorrectly
assumed that the return value from os_addrinfo_intern would never be
NULL, and therefore would call freeadrinfo with a null pointer, causing
a segmentation fault.

This should fix #3685.

`os_socket_listen`, `os_socket_connect` and `os_connect` incorrectly
assumed that the return value from `os_addrinfo_intern` would never be
NULL, and therefore would call freeadrinfo with a null pointer, causing
a segmentation fault.
@ergl ergl marked this pull request as draft December 19, 2020 22:56
@ergl ergl marked this pull request as ready for review December 19, 2020 22:57
@ergl
Copy link
Member Author

ergl commented Dec 20, 2020

I'll try to add a test case for this day, so this shouldn't be merged yet.

@SeanTAllen SeanTAllen added the changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge label Dec 20, 2020
@ponylang-main
Copy link
Contributor

Hi @ergl,

The changelog - fixed label was added to this pull request; all PRs with a changelog label need to have release notes included as part of the PR. If you haven't added release notes already, please do.

Release notes are added by creating a uniquely named file in the .release-notes directory. We suggest you call the file 3687.md to match the number of this pull request.

The basic format of the release notes (using markdown) should be:

## Title

End user description of changes, why it's important,
problems it solves etc.

If a breaking change, make sure to include 1 or more
examples what code would look like prior to this change
and how to update it to work after this change.

Thanks.

@SeanTAllen SeanTAllen added the do not merge This PR should not be merged at this time label Dec 20, 2020
@SeanTAllen
Copy link
Member

@ergl still working on a test case?

@ergl
Copy link
Member Author

ergl commented Dec 23, 2020

Hi @SeanTAllen, I gave this a look, but I wasn't able to trigger a segfault like it happened in #3685. Even forcing a failure in getaddrinfo with LD_PRELOAD didn't cause a segfault.

In any case, I think it would be hard to have a reliable test for this, so maybe it's not needed. I'll write the release notes and push that later.

@SeanTAllen
Copy link
Member

Sounds good @ergl.

@SeanTAllen SeanTAllen removed the do not merge This PR should not be merged at this time label Dec 26, 2020
@SeanTAllen SeanTAllen merged commit 977f60f into ponylang:master Dec 26, 2020
github-actions bot pushed a commit that referenced this pull request Dec 26, 2020
github-actions bot pushed a commit that referenced this pull request Dec 26, 2020
@ergl ergl deleted the fix-3685 branch December 26, 2020 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog - fixed Automatically add "Fixed" CHANGELOG entry on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Segfault in os_socket_connect
3 participants