summaryrefslogtreecommitdiffstats
path: root/main/musl/1001-fix-gethostbyaddr_r-to-fill-struct-hostent.h_length-.patch
blob: f126336e972bb46f1dd7b059bcee0f28d969e47d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
From d378d05848f745598216259b6dba7c70f0e90300 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Tue, 22 Mar 2016 16:27:51 +0200
Subject: [PATCH] fix gethostbyaddr_r to fill struct hostent.h_length as
 appropriate

---
 src/network/gethostbyaddr_r.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c
index 66e0330..0f1e61a 100644
--- a/src/network/gethostbyaddr_r.c
+++ b/src/network/gethostbyaddr_r.c
@@ -64,6 +64,7 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af,
 	}
 
 	h->h_addrtype = af;
+	h->h_length = l;
 	h->h_name = h->h_aliases[0];
 	*res = h;
 	return 0;
-- 
2.7.4