From b14f5fc0a9044b41f734e965e47a07bcebed7efe Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Tue, 13 Feb 2024 09:41:42 -0500 Subject: [PATCH] length check envParts Signed-off-by: Tiger Kaovilai --- pkg/distribution/configuration/parser.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/distribution/configuration/parser.go b/pkg/distribution/configuration/parser.go index 301560e..628bc68 100644 --- a/pkg/distribution/configuration/parser.go +++ b/pkg/distribution/configuration/parser.go @@ -92,6 +92,9 @@ func NewParser(prefix string, envs []string, parseInfos []configuration.Versione for _, env := range envs { envParts := strings.SplitN(env, "=", 2) + if len(envParts) < 2 { + continue + } p.env = append(p.env, envVar{envParts[0], envParts[1]}) }