projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
595416b
)
getservbyport_r: fix wrong result if getnameinfo fails with EAI_OVERFLOW
author
Alexey Izbyshev
<izbyshev@ispras.ru>
Mon, 27 Feb 2023 20:33:08 +0000
(23:33 +0300)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 28 Feb 2023 17:01:34 +0000
(12:01 -0500)
EAI_OVERFLOW should be propagated as ERANGE to inform the caller about
the need to expand the buffer.
src/network/getservbyport_r.c
patch
|
blob
|
history
diff --git
a/src/network/getservbyport_r.c
b/src/network/getservbyport_r.c
index
d3a22b8
..
e4cc307
100644
(file)
--- a/
src/network/getservbyport_r.c
+++ b/
src/network/getservbyport_r.c
@@
-46,6
+46,8
@@
int getservbyport_r(int port, const char *prots,
case EAI_MEMORY:
case EAI_SYSTEM:
return ENOMEM;
+ case EAI_OVERFLOW:
+ return ERANGE;
default:
return ENOENT;
case 0: