Skip to content

Commit 0791425

Browse files
committed
add nil check for c.socksServer
1 parent cac0114 commit 0791425

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/client.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,11 @@ func (c *Client) connectStreams(chans <-chan ssh.NewChannel) {
287287
for ch := range chans {
288288
remote := string(ch.ExtraData())
289289
socks := remote == "socks"
290+
if socks && c.socksServer == nil {
291+
c.Debugf("Denied socks request, please enable client socks remote.")
292+
ch.Reject(ssh.Prohibited, "SOCKS5 is not enabled on the client")
293+
continue
294+
}
290295
stream, reqs, err := ch.Accept()
291296
if err != nil {
292297
c.Debugf("Failed to accept stream: %s", err)

0 commit comments

Comments
 (0)