about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexey Izbyshev <izbyshev@ispras.ru>2023-02-27 23:33:08 +0300
committerRich Felker <dalias@aerifal.cx>2023-02-28 12:01:34 -0500
commitb1dfb734a45d4f74c7a24c5f07d37f7e74451802 (patch)
tree98615373c1a7645e9962d1eb096bee0d36f770cd /src
parent595416b11dfbc82d40a59d0edd7e3b04ba7a2d6d (diff)
downloadmusl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.tar.gz
musl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.tar.xz
musl-b1dfb734a45d4f74c7a24c5f07d37f7e74451802.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/network/getservbyport_r.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/getservbyport_r.c b/src/network/getservbyport_r.c
index d3a22b8c..e4cc3079 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: