projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b4d94ba
)
make getaddrinfo return error if both host and service name are null
author
Rich Felker
<dalias@aerifal.cx>
Fri, 25 Sep 2015 01:01:11 +0000
(
01:01
+0000)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 25 Sep 2015 01:03:36 +0000
(
01:03
+0000)
this case is specified as a mandatory ("shall fail") error.
based on patch by Julien Ramseier.
src/network/getaddrinfo.c
patch
|
blob
|
history
diff --git
a/src/network/getaddrinfo.c
b/src/network/getaddrinfo.c
index c88d558c49811d249690eeffdf75a2ed9c5c7b4e..b9439f776fcebf41e00ed1e6fff674b7a42ea1be 100644
(file)
--- 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;