ssh icon indicating copy to clipboard operation
ssh copied to clipboard

Missing Handler causes panic

Open nerg4l opened this issue 1 year ago • 0 comments

When I try to connect to a server without specifying a handler on the server. I only defined SubsystemHandlers just like it is shown in the SFTP example.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x100961b94]

goroutine 44 [running]:
github.com/gliderlabs/ssh.(*session).handleRequests.func1()
        /Users/lgorog/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:261 +0x24
created by github.com/gliderlabs/ssh.(*session).handleRequests in goroutine 24
        /Users/lgorog/go/pkg/mod/github.com/gliderlabs/[email protected]/session.go:260 +0x518

It would be better to detect it when Listen starts or even better just immediately close/reject the connection.

nerg4l avatar Sep 29 '24 18:09 nerg4l