From a459bba20e5a2531ca36aa4ba5d2fbc3b7c267dc Mon Sep 17 00:00:00 2001 From: rahulkhinchi-wq Date: Wed, 26 Nov 2025 20:22:34 +0530 Subject: [PATCH] fix: dangerous-exec-command-87 (#6999) Co-authored-by: root --- e2e/cli.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/cli.go b/e2e/cli.go index aa6488ea7..262dc44ef 100644 --- a/e2e/cli.go +++ b/e2e/cli.go @@ -17,6 +17,7 @@ limitations under the License. package e2e import ( + "fmt" "os" "os/exec" "path" @@ -83,6 +84,9 @@ func asyncExec(cli string) (*gexec.Session, error) { func LongTimeExecWithEnv(cli string, timeout time.Duration, env []string) (string, error) { var output []byte c := strings.Fields(cli) + if len(c) == 0 { + return "", fmt.Errorf("empty command") + } commandName := path.Join(rudrPath, c[0]) command := exec.Command(commandName, c[1:]...) command.Env = os.Environ()