Merge pull request #8329 from hashicorp/fix_8325
builder/virtualbox/common/snapshot.go: avoid a panic on a too short slice.
This commit is contained in:
commit
d7b2aa88c4
|
@ -35,7 +35,7 @@ func ParseSnapshotData(snapshotData string) (*VBoxSnapshot, error) {
|
|||
node.IsCurrent = true
|
||||
} else {
|
||||
matches := SnapshotNamePartsRe.FindStringSubmatch(txt)
|
||||
if matches[1] == "Name" {
|
||||
if len(matches) >= 2 && matches[1] == "Name" {
|
||||
if nil == rootNode {
|
||||
node = new(VBoxSnapshot)
|
||||
rootNode = node
|
||||
|
|
Loading…
Reference in New Issue