obfsvpn crashes in obfs4 mode
The panic happend when obfsvpn server was misconfigured. Obfsvpn was configured to look for openvpn on 127.0.0.1., but the openvpn server was not running there.
However the error should be returned and the server should stop gracefully instead of a nil pointer exception.
2024/06/11 15:22:49 Error binding to openvpn-server:5540: lookup openvpn-server on 127.0.0.11:53: no such host
2024/06/11 15:22:49 error dialing to <nil>: dial udp: missing address
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x52c937]
goroutine 23 [running]:
net.(*UDPConn).readFromUDP(0x0?, {0xc00020ff25?, 0x0?, 0x0?}, 0x0?)
/usr/local/go/src/net/udpsock.go:146 +0x17
net.(*UDPConn).ReadFromUDP(...)
/usr/local/go/src/net/udpsock.go:141
0xacab.org/leap/obfsvpn/obfsvpn.ReadUDPFrameTCP(0x0, {0xc00020ff25, 0xffe3, 0xffe3})
/go/src/0xacab.org/leap/obfsvpn/obfsvpn/framing.go:47 +0x6f
0xacab.org/leap/obfsvpn/server.readUDPWriteTCP({0x7bbd60, 0xc000114070}, 0x0, 0xc00006d380, 0xc00006d350?)
/go/src/0xacab.org/leap/obfsvpn/server/udpserver.go:147 +0x7c
created by 0xacab.org/leap/obfsvpn/server.(*UDPServer).acceptLoop in goroutine 12
/go/src/0xacab.org/leap/obfsvpn/server/udpserver.go:122 +0x615
Server exited. Killing background process.