From 427aa1ee2e1386ea8060269ddbd178ac9d662ce7 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 13 Feb 2020 21:48:20 +0100 Subject: [PATCH] Fix: Panic on invalid entries in env-file Signed-off-by: Knut Ahlers --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 697d666..853e30f 100644 --- a/main.go +++ b/main.go @@ -57,6 +57,10 @@ func envListToMap(list []string) map[string]string { } parts := strings.SplitN(entry, "=", 2) + if len(parts) != 2 { + log.WithField("entry", entry).Warn("Invalid env-file entry") + continue + } out[parts[0]] = parts[1] } return out