| Summary: | getnameinfo() dumps core on 131.118.32.4 | ||
|---|---|---|---|
| Product: | Base System | Reporter: | Bill Fenner <fenner> |
| Component: | bin | Assignee: | Hajimu UMEMOTO <ume> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.0-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
Responsible Changed From-To: freebsd-bugs->shin Over to Inoue-san, whose code this seems to be. Responsible Changed From-To: shin->ume Inoue-san seems unavailable at the moment. State Changed From-To: open->closed It should be corrected by getipnodebyaddr() side and committed. (libc/net/name6.c rev 1.14) Thank you for reporting it. |
getnameinfo() dumps core on 131.118.32.4 It assumes that getipnodebyaddr() can not return an hp->h_name of NULL. However, it can, with the odd PTR record that 131.118.32.4 has: 4.32.118.131.in-addr.arpa. 1D IN PTR . I don't know if this is a bug in getipnodebyaddr() or getnameinfo(). Fix: Unknown. Workaround: don't try to look up this IP address using getnameinfo(). How-To-Repeat: #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> int main(int argc,char **argv) { struct sockaddr_in sin; char _hostname[256]; sin.sin_family = AF_INET; sin.sin_len = sizeof(sin); sin.sin_addr.s_addr = inet_addr("131.118.32.4"); getnameinfo((struct sockaddr*)&sin, sin.sin_len, _hostname, sizeof(_hostname) - 1, NULL, 0, NI_NAMEREQD); }