From 2f072dfc204d5e8c564592df9429bc77f5f62632 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Sat, 1 Dec 2012 10:54:14 -0800 Subject: [PATCH] auth: fix nil dereference crash Change-Id: I4552829da795236b9c875a753b6f1d710066d89a --- pkg/auth/auth.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index 66dd401c8..6a80ac061 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -163,11 +163,11 @@ func localhostAuthorized(req *http.Request) bool { uid := os.Getuid() from, err := netutil.HostPortToIP(req.RemoteAddr) if err != nil { - fmt.Printf("auth: could not resolve the TCPAddr: %v", err) + return false } to, err := netutil.HostPortToIP(req.Host) if err != nil { - fmt.Printf("auth: could not resolve the TCPAddr: %v", err) + return false } // If our OS doesn't support uid.