X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fnetwork%2Fgethostbyaddr_r.c;h=66e03309408c9df979a0949a2f23acf3bd8b8591;hb=fe82bb9b921be34370e6b71a1c6f062c20999ae0;hp=73e764474a58a2a13542935df98983c66840add0;hpb=2e5d256984adb6864ece82fb689ddb2b20e10e4d;p=musl diff --git a/src/network/gethostbyaddr_r.c b/src/network/gethostbyaddr_r.c index 73e76447..66e03309 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);