From da8934445aa10099bf05813c57858e56c1654e12 Mon Sep 17 00:00:00 2001 From: Paul Stuart Date: Sat, 14 May 2016 16:45:44 -0700 Subject: [PATCH] bounds checking --- internal/config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/config/config.go b/internal/config/config.go index 1f5b64873..a88fb9a73 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -553,6 +553,9 @@ func parseFile(fpath string) (*ast.Table, error) { for _, env_var := range env_vars { str := strings.TrimPrefix(string(env_var), "$(") args := strings.Fields(strings.TrimSuffix(str, ")")) + if len(args) == 0 { + return nil, fmt.Errorf("Empty command string") + } v, err := exec.Command(args[0], args[1:]...).Output() if err != nil { return nil, err