diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c index 73e764474a58a2a13542935df98983c66840add0..66e03309408c9df979a0949a2f23acf3bd8b8591 100644 --- a/src/network/gethostbyaddr_r.c +++ b/src/network/gethostbyaddr_r.c @@ -18,6 +18,8 @@ int gethostbyaddr_r(const void *a, socklen_t l, int af, socklen_t sl = af==AF_INET6 ? sizeof sa.sin6 : sizeof sa.sin; int i; + *res = 0; + /* Load address argument into sockaddr structure */ if (af==AF_INET6 && l==16) memcpy(&sa.sin6.sin6_addr, a, 16); else if (af==AF_INET && l==4) memcpy(&sa.sin.sin_addr, a, 4); diff --git a/src/network/gethostbyname2_r.c b/src/network/gethostbyname2_r.c index aa8b0a9ee5031bf67e6259ca5921ca61f957a24d..81f71d2160fef695510d53063ba7b8d55716977f 100644 --- a/src/network/gethostbyname2_r.c +++ b/src/network/gethostbyname2_r.c @@ -17,6 +17,7 @@ int gethostbyname2_r(const char *name, int af, int i, cnt; size_t align, need; + *res = 0; cnt = __lookup_name(addrs, canon, name, af, AI_CANONNAME); if (cnt<0) switch (cnt) { case EAI_NONAME: