Commit 65d391db authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

communicator/ssh: explicitly set c.conn = nil

parent 94487871
......@@ -8,6 +8,8 @@ BUG FIXES:
* builder/digitalocean: scrub API keys from config debug output [GH-516]
* builder/virtualbox: error if VirtualBox version cant be detected. [GH-488]
* builder/virtualbox: detect if vboxdrv isn't properly setup. [GH-488]
* communicator/ssh: Fix issue where a panic could arise from a nil
dereference. [GH-525]
## 0.3.9 (October 2, 2013)
......
......@@ -238,6 +238,14 @@ func (c *comm) reconnect() (err error) {
log.Printf("reconnecting to TCP connection for SSH")
c.conn, err = c.config.Connection()
if err != nil {
// Explicitly set this to the REAL nil. Connection() can return
// a nil implementation of net.Conn which will make the
// "if c.conn == nil" check fail above. Read here for more information
// on this psychotic language feature:
//
// http://golang.org/doc/faq#nil_error
c.conn = nil
log.Printf("reconnection error: %s", err)
return
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment