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-Tag: v1.1.12~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=06bcf9bc941a2f3bf34ac4468644d9693802495b;p=oweals%2Fmusl.git 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;