Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 1693fbd

Browse files
authored
Merge pull request #1185 from ulyssessouza/fix-array-out-of-bounds
Add defensive code
2 parents a96ceac + cd233ce commit 1693fbd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

local/compose/create.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ func getVolumesFrom(project *types.Project, volumesFrom []string) ([]string, []s
315315
}
316316
for _, vol := range volumesFrom {
317317
spec := strings.Split(vol, ":")
318+
if len(spec) == 0 {
319+
continue
320+
}
318321
if spec[0] == "container" {
319322
volumes = append(volumes, strings.Join(spec[1:], ":"))
320323
continue

0 commit comments

Comments
 (0)