diff options
| author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2005-04-29 12:01:36 +0000 |
|---|---|---|
| committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2005-04-29 12:01:36 +0000 |
| commit | 0d389e72128de70e70e58c1a16b150fb12c819ad (patch) | |
| tree | e795a4f21fc7c39d6c9aa612a29289b4e3a6aad4 /lib/libc/net/gethostbynis.c | |
| parent | e47099593aa3542ac99ca83d07d6782056da484e (diff) | |
Notes
Diffstat (limited to 'lib/libc/net/gethostbynis.c')
| -rw-r--r-- | lib/libc/net/gethostbynis.c | 6 |
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 */ |
