projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fix getservby*() with null pointer for protocol argument
[musl]
/
src
/
network
/
getservbyport_r.c
diff --git
a/src/network/getservbyport_r.c
b/src/network/getservbyport_r.c
index
f119abc
..
821afae
100644
(file)
--- a/
src/network/getservbyport_r.c
+++ b/
src/network/getservbyport_r.c
@@
-15,6
+15,10
@@
int getservbyport_r(int port, const char *prots,
.sin_port = port,
};
+ if (!prots) return -(
+ getservbyport_r(port, "tcp", se, buf, buflen, res)
+ && getservbyport_r(port, "udp", se, buf, buflen, res) );
+
/* Align buffer */
i = (uintptr_t)buf & sizeof(char *)-1;
if (!i) i = sizeof(char *);