Closed riklus closed 2 years ago
I tried using the dispatch proxy with qBitTorrent (SOCK5 proxy) and this happened:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x10d4b00] goroutine 402 [running]: main.client_greeting({0x0, 0x0}) /Users/riklus/cloned-repos/go-dispatch-proxy/socks.go:18 +0x40 main.handle_socks_connection({0x0, 0x0}) /Users/riklus/cloned-repos/go-dispatch-proxy/socks.go:134 +0x27 main.handle_connection({0x0, 0x0}, 0x0) /Users/riklus/cloned-repos/go-dispatch-proxy/main.go:99 +0x3a created by main.main /Users/riklus/cloned-repos/go-dispatch-proxy/main.go:254 +0x50c
When the function client_greeting is called the parameter conn appears to be (for some reason) nil. I verified it by checking conn inside client_greeting by adding an if statement and it's really nil.
client_greeting
file socks.go
15 func client_greeting(conn net.Conn) (byte, []byte, error) { 16+ if conn == nil { 17+ fmt.Print("[PANIC] conn is nil") 18+ } 19 buf := make([]byte, 2) 20
As a quick fix we could check if conn is nil and then return an error, but I don't know why conn is null in the first place.
Now that I checked the documentation of net package it appears that the accepted connection's error is not properly handled inside main.go line 253.
I tried using the dispatch proxy with qBitTorrent (SOCK5 proxy) and this happened:
When the function
client_greeting
is called the parameter conn appears to be (for some reason) nil. I verified it by checking conn insideclient_greeting
by adding an if statement and it's really nil.file socks.go
As a quick fix we could check if conn is nil and then return an error, but I don't know why conn is null in the first place.