From b4c9e7124a31e3753c7a51c02df96e3ba384effe Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 12 Aug 2021 14:03:40 +0200 Subject: [PATCH 1/2] fix macos panic dereferencing when passing a []byte version of certificate or key as cert|keyFileOrContents to iris.TLS() if len(certFileOrContents) > 1024 the error returned will be Filename too long and os.IsNotExist(err) will be false --- core/host/supervisor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/host/supervisor.go b/core/host/supervisor.go index 80f34a2b..e6fbd813 100644 --- a/core/host/supervisor.go +++ b/core/host/supervisor.go @@ -517,9 +517,10 @@ func (su *Supervisor) shutdownOnInterrupt(ctx context.Context) { // fileExists tries to report whether a local physical file of "filename" exists. func fileExists(filename string) bool { info, err := os.Stat(filename) - if os.IsNotExist(err) { + if err != nil { return false } + return !info.IsDir() } From 78108ac96c840fd0de9af20f68e0c571b7f9b62b Mon Sep 17 00:00:00 2001 From: Kim Date: Thu, 12 Aug 2021 14:09:44 +0200 Subject: [PATCH 2/2] remove extra newline --- core/host/supervisor.go | 1 - 1 file changed, 1 deletion(-) diff --git a/core/host/supervisor.go b/core/host/supervisor.go index e6fbd813..e8ea77a6 100644 --- a/core/host/supervisor.go +++ b/core/host/supervisor.go @@ -521,6 +521,5 @@ func fileExists(filename string) bool { return false } - return !info.IsDir() }