From 116a038de992c3235e7673c09296ff5344eaab5a Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Tue, 5 Nov 2019 15:48:32 +0100 Subject: [PATCH] Update snapshot.go avoid a panic on a too short slice. --- builder/virtualbox/common/snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/virtualbox/common/snapshot.go b/builder/virtualbox/common/snapshot.go index e68540182..bb55ade41 100644 --- a/builder/virtualbox/common/snapshot.go +++ b/builder/virtualbox/common/snapshot.go @@ -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