diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-10-19 00:28:47 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-10-19 00:28:47 +0000 |
commit | 2309700dd3739d8e5103257887c26835e135b5b5 (patch) | |
tree | e3087e624ef786e6787b0fcd1db8ad2eb39bc12b /libc/inet | |
parent | c5c91dc7df8e53b643395cdf0ca38a628a8d8173 (diff) |
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
Diffstat (limited to 'libc/inet')
-rw-r--r-- | libc/inet/resolv.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 |