summaryrefslogtreecommitdiff
path: root/lib/libc/net/gethostbynis.c
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2005-04-29 12:01:36 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2005-04-29 12:01:36 +0000
commit0d389e72128de70e70e58c1a16b150fb12c819ad (patch)
treee795a4f21fc7c39d6c9aa612a29289b4e3a6aad4 /lib/libc/net/gethostbynis.c
parente47099593aa3542ac99ca83d07d6782056da484e (diff)
Notes
Diffstat (limited to 'lib/libc/net/gethostbynis.c')
-rw-r--r--lib/libc/net/gethostbynis.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/net/gethostbynis.c b/lib/libc/net/gethostbynis.c
index 386b31259bf9..e9cc2053fb28 100644
--- a/lib/libc/net/gethostbynis.c
+++ b/lib/libc/net/gethostbynis.c
@@ -171,6 +171,7 @@ _gethostbynisaddr_r(const char *addr, int len, int af, struct hostent *he,
struct hostent_data *hed)
{
char *map;
+ char numaddr[46];
switch (af) {
case AF_INET:
@@ -180,8 +181,9 @@ _gethostbynisaddr_r(const char *addr, int len, int af, struct hostent *he,
map = "ipnodes.byaddr";
break;
}
- return _gethostbynis(inet_ntoa(*(struct in_addr *)addr), map, af, he,
- hed);
+ if (inet_ntop(af, addr, numaddr, sizeof(numaddr)) == NULL)
+ return -1;
+ return _gethostbynis(numaddr, map, af, he, hed);
}
#endif /* YP */