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.
This commit is contained in:
Dave Collins 2016-11-11 20:49:22 -06:00
parent c31eb4549d
commit 9b76b78168
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -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 {