mirror of https://github.com/docker/compose.git
Merge pull request #1185 from ulyssessouza/fix-array-out-of-bounds
Add defensive code
This commit is contained in:
commit
1693fbdf34
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue