cloudfoundry-attic / bosh-init

bosh-init is a tool used to create and update the Director VM
Apache License 2.0
31 stars 33 forks source link

error not handled, leads to index-out-of-range panic #36

Closed Amit-PivotalLabs closed 9 years ago

Amit-PivotalLabs commented 9 years ago

See here:

https://github.com/cloudfoundry/bosh-init/blob/7ac660daf034bd293ed37e44c5a3a97e99624c06/installation/installer.go#L77-L78

When there's an error, the returned value is nil/empty, and accessing its 0th element panics.

maximilien commented 9 years ago

Seems like (obviously) there should have been a check for error right after this:

renderedJobRefs, err := i.jobRenderer.RenderAndUploadFrom(manifest, jobs, stage)
if err != nil {
  //RECOVER if you can or return it
}
cppforlife commented 9 years ago

Fixed by https://github.com/cloudfoundry/bosh-init/commit/9e51b8934ff8390ad1ed6803189a93c44aebb930