diff options
author | Alexey Izbyshev <izbyshev@ispras.ru> | 2023-02-27 23:33:08 +0300 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2023-02-28 12:01:34 -0500 |
commit | b1dfb734a45d4f74c7a24c5f07d37f7e74451802 (patch) | |
tree | 98615373c1a7645e9962d1eb096bee0d36f770cd | |
parent | 595416b11dfbc82d40a59d0edd7e3b04ba7a2d6d (diff) | |
download | musl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.zip musl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.tar.gz musl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.tar.bz2 |
getservbyport_r: fix wrong result if getnameinfo fails with EAI_OVERFLOW
EAI_OVERFLOW should be propagated as ERANGE to inform the caller about
the need to expand the buffer.
-rw-r--r-- | src/network/getservbyport_r.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c index d3a22b8..e4cc307 100644 --- 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: |