Sfoglia il codice sorgente

Merge pull request #1185 from ulyssessouza/fix-array-out-of-bounds

Add defensive code
Guillaume Tardif 4 anni fa
parent
commit
1693fbdf34
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      local/compose/create.go

+ 3 - 0
local/compose/create.go

@@ -315,6 +315,9 @@ func getVolumesFrom(project *types.Project, volumesFrom []string) ([]string, []s
 	}
 	for _, vol := range volumesFrom {
 		spec := strings.Split(vol, ":")
+		if len(spec) == 0 {
+			continue
+		}
 		if spec[0] == "container" {
 			volumes = append(volumes, strings.Join(spec[1:], ":"))
 			continue