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

guard against nil {Local,Remote}Addr() return values #155

Merged

Conversation

marten-seemann
Copy link
Contributor

Fixes ipfs/kubo#8211. As discussed in ipfs/kubo#8211 (comment), I'm not sure why LocalAddr() of a net.Conn would ever return nil, but as evidenced by the stack trace, it can happen (maybe just on certain architectures).

Playing it safe, we can check that the value is not nil before using it.

Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is strange... but yeah, we might as well do it.

@marten-seemann marten-seemann merged commit 7cb054e into multiformats:master Jun 24, 2021
@marten-seemann marten-seemann deleted the guard-against-nil-addrs branch June 24, 2021 01:54
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.

v0.9.0 panics on OpenBSD
2 participants