mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
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…
x
Reference in New Issue
Block a user