Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting segfault for DialSSH call when incorrect ssh username/password provided. #90

Closed
paulsubrata55 opened this issue Aug 25, 2019 · 2 comments
Labels

Comments

@paulsubrata55
Copy link
Contributor

  • What is the issue
    Getting segfault for DialSSH call when incorrect ssh username/password provided. This is caused due to PR added close to ssh connection if the subsystem connection fails #87. The TransportSSH.Dial failure may happen due to many reasons, one of them is incorrect username/password. In this scenario there is no valid ssh connection to close.
  • What is expected
    netconf client must not crash for incorrect ssh username/password.
  • How it can be solved (suggestion)
    Detect there is a valid ssh connection before closing one.
@paulsubrata55
Copy link
Contributor Author

stack trace below:

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

goroutine 1 [running]:
github.com/Juniper/go-netconf/netconf.(*TransportSSH).Close(0xc00008abc0, 0x5fca8d, 0xe)
	/home/user/Practice/gopath/src/github.com/Juniper/go-netconf/netconf/transport_ssh.go:49 +0x33
github.com/Juniper/go-netconf/netconf.DialSSH(0x5fca8d, 0xe, 0xc000042ec0, 0xc00008ab80, 0x634ba0, 0xb)
	/home/user/Practice/gopath/src/github.com/Juniper/go-netconf/netconf/transport_ssh.go:115 +0x89
main.main()
	/home/user/Practice/netconf-go/main.go:22 +0x17f

@kpostrup
Copy link

If no one has any objections to this, can it please be merged?
I've tested it locally and it solves the problem for me.

@nemith nemith added the bug label Jul 22, 2022
@nemith nemith closed this as completed Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants