From: Rich Felker Date: Fri, 25 Sep 2015 01:01:11 +0000 (+0000) Subject: make getaddrinfo return error if both host and service name are null X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=06bcf9bc941a2f3bf34ac4468644d9693802495b;p=musl make getaddrinfo return error if both host and service name are null this case is specified as a mandatory ("shall fail") error. based on patch by Julien Ramseier. --- diff --git a/src/network/getaddrinfo.c b/src/network/getaddrinfo.c index c88d558c..b9439f77 100644 --- a/src/network/getaddrinfo.c +++ b/src/network/getaddrinfo.c @@ -20,6 +20,8 @@ int getaddrinfo(const char *restrict host, const char *restrict serv, const stru } sa; } *out; + if (!host && !serv) return EAI_NONAME; + if (hint) { family = hint->ai_family; flags = hint->ai_flags;