From 9b76b7816871a0eb228daa94337d132924fec598 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Fri, 11 Nov 2016 20:49:22 -0600 Subject: [PATCH] server: Return error on address lookup fails. This corrects an issue introduced by commit e8f63bc29550705268b533032ccc2ea24f8c86ba where a failure to lookup a hostname could lead to a panic in certain circumstances. An error is now returned in that case as expected. --- server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server.go b/server.go index 7b9dfc69..a1513b99 100644 --- a/server.go +++ b/server.go @@ -2504,6 +2504,9 @@ func addrStringToNetAddr(addr string) (net.Addr, error) { if err != nil { return nil, err } + if len(ips) == 0 { + return nil, fmt.Errorf("no addresses found for %s", host) + } port, err := strconv.Atoi(strPort) if err != nil {