From c3cc4b36ba8fb4811121c90c78b65a86f1577983 Mon Sep 17 00:00:00 2001 From: rajasec Date: Sat, 9 Apr 2016 23:12:54 +0530 Subject: [PATCH] Fixing index out of range during exec of container Signed-off-by: rajasec Fixed review comments Signed-off-by: rajasec updated the arguments check as per review comment Signed-off-by: rajasec --- exec.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exec.go b/exec.go index 76525886..e4220c4d 100644 --- a/exec.go +++ b/exec.go @@ -99,6 +99,10 @@ func execProcess(context *cli.Context) (int, error) { if err != nil { return -1, err } + path := context.String("process") + if path == "" && len(context.Args()) == 1 { + return -1, fmt.Errorf("process args cannot be empty") + } detach := context.Bool("detach") state, err := container.State() if err != nil {