Juniper / go-netconf

NETCONF implementation in Go.
Other
253 stars 110 forks source link

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

Closed paulsubrata55 closed 2 years ago

paulsubrata55 commented 5 years ago
paulsubrata55 commented 5 years ago

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 commented 4 years ago

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.