From 5887472a6f77f1c26a90aa5667d473c2e083ca14 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 28 Aug 2013 11:21:02 -0700 Subject: [PATCH] packer/plugin: fix nil deref during ctrl-c of provisioner --- CHANGELOG.md | 2 ++ packer/plugin/provisioner.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 510862a25..f311e5441 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## 0.3.6 (unreleased) +BUG FIXES: +* core: Fix possible panic when ctrl-C during provisioner run. ## 0.3.5 (August 28, 2013) diff --git a/packer/plugin/provisioner.go b/packer/plugin/provisioner.go index d990bc70b..7445c4165 100644 --- a/packer/plugin/provisioner.go +++ b/packer/plugin/provisioner.go @@ -29,7 +29,7 @@ func (c *cmdProvisioner) Provision(ui packer.Ui, comm packer.Communicator) error } func (c *cmdProvisioner) checkExit(p interface{}, cb func()) { - if c.client.Exited() { + if c.client.Exited() && cb != nil { cb() } else if p != nil && !Killed { log.Panic(p)