-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
I believe this code is producing the following panics that I'm seeing:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6c3542]
goroutine 651 [running]:
github.com/things-go/go-socks5.(*Server).handleAssociate.func2.2()
github.com/things-go/go-socks5@v0.1.0/handle.go:280 +0x4e2
created by github.com/things-go/go-socks5.(*Server).goFunc in goroutine 130
github.com/things-go/go-socks5@v0.1.0/server.go:200 +0x3e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6c3542]
goroutine 675 [running]:
github.com/things-go/go-socks5.(*Server).handleAssociate.func2.2()
github.com/things-go/go-socks5@v0.1.0/handle.go:280 +0x4e2
created by github.com/things-go/go-socks5.(*Server).goFunc in goroutine 130
github.com/things-go/go-socks5@v0.1.0/server.go:200 +0x3e
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x6c3542]
goroutine 781 [running]:
github.com/things-go/go-socks5.(*Server).handleAssociate.func2.2()
github.com/things-go/go-socks5@v0.1.0/handle.go:280 +0x4e2
created by github.com/things-go/go-socks5.(*Server).goFunc in goroutine 130
github.com/things-go/go-socks5@v0.1.0/server.go:200 +0x3e
So when RemoteAddr() is nil (which happens), calling .String() causes the panic.
The same issue exists elsewhere in this function too:
targetNew.RemoteAddr().String()in the write-error logtarget.(net.Conn).RemoteAddr().String()in the else branch
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels