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

websocket: fix nil pointer in tlsClientConf #1770

Merged
merged 1 commit into from
Sep 21, 2022

Conversation

MarcoPolo
Copy link
Collaborator

It's possible (and common) to have a WebSocket transport without a tls client config. This leads to a nil pointer deref error when we set the ServerName.

This sets a default empty tlsClientConf and adds a test case.

Fixes #1769

@github-actions
Copy link

Suggested version: v0.23.1
Comparing to: v0.23.0 (diff)

Changes in go.mod file(s):

(empty)

gorelease says:

# diagnostics
go.mod: the following requirements are needed
	github.com/libp2p/go-yamux/v3@v3.1.2
Run go mod tidy to add missing requirements.
required module github.com/microcosm-cc/bluemonday@v1.0.1 retracted by module author: Retract older versions as only latest is to be depended upon

# summary
Suggested version: v0.23.1

gocompat says:

(empty)

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

The fix and the test case LGTM, but I’d like to investigate the gorelease warning regarding yamux before doing the patch release. Will do so later today.

Comment on lines -168 to -171
// l, err := tpt.Listen(ma.StringCast("/ip4/127.0.0.1/tcp/0/wss"))
// l, err := tpt.Listen(ma.StringCast("/ip4/127.0.0.1/tcp/0/tls/ws"))
l, err := tpt.Listen(listenAddr)
fmt.Println("here", listenAddr)
Copy link
Contributor

Choose a reason for hiding this comment

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

🤔 🙂

@marten-seemann
Copy link
Contributor

I removed the release commit. Let's first make sure we can build kubo before cutting a patch release.

@marten-seemann marten-seemann merged commit fa70f6e into master Sep 21, 2022
@Jorropo Jorropo deleted the marco/fix-nil-pointer branch September 21, 2022 19:38
@Jorropo Jorropo restored the marco/fix-nil-pointer branch September 21, 2022 19:38
@Jorropo Jorropo deleted the marco/fix-nil-pointer branch September 21, 2022 20:28
@marten-seemann marten-seemann mentioned this pull request Sep 21, 2022
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.

invalid memory address or nil pointer dereference in go-libp2p/p2p/transport/websocket
3 participants