From 2309700dd3739d8e5103257887c26835e135b5b5 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sun, 19 Oct 2003 00:28:47 +0000 Subject: We were failing to properly set h_errno on success, which could cause gethostbyaddr_r to keep looping allocating more and more memory each time till alloca finally caused a segfault. Ugh. This fixes that as well... -Erik --- libc/inet/resolv.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libc/inet/resolv.c') diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c index cd595c93d..43ed9ae1e 100644 --- a/libc/inet/resolv.c +++ b/libc/inet/resolv.c @@ -1755,6 +1755,7 @@ int gethostbyname_r(const char * name, } *result=result_buf; + *h_errnop = NETDB_SUCCESS; return NETDB_SUCCESS; } #endif @@ -1882,6 +1883,7 @@ int gethostbyname2_r(const char *name, int family, } *result=result_buf; + *h_errnop = NETDB_SUCCESS; return NETDB_SUCCESS; #endif /* __UCLIBC_HAS_IPV6__ */ } @@ -2064,6 +2066,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type, } *result=result_buf; + *h_errnop = NETDB_SUCCESS; return NETDB_SUCCESS; } #endif -- cgit v1.2.3