Operating System - HP-UX
1833568 Members
3402 Online
110061 Solutions
New Discussion

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

 
Steven Hatley
New Member

gethostbyaddr() can easily core dump using this IP: 66.106.204.66

Has anyone seen this problem addressed by an HPUX patch? I find no information and the closest patch "PHNE_27795" doesn't fix my problem. Here's the stack trace after 27795 was applied:


(gdb) where
#0 0xc015b39c in __strlen20 () from /usr/lib/libc.2
#1 0xc02f6f54 in dns_netdb_aliases () from /usr/lib/libnss_dns.1
#2 0xc02f6e1c in ent2result () from /usr/lib/libnss_dns.1
#3 0xc02f69a0 in free () from /usr/lib/libnss_dns.1
#4 0xc01d9164 in nss_search () from /usr/lib/libc.2
#5 0xc0141dbc in gethostbyaddr () from /usr/lib/libc.2
#6 0x2650 in iptohost (ip=0x7b030510 "66.106.204.66") at hpux_os_bug.c:52
#7 0x25a4 in main (argc=1, argv=0x7b0303e4) at hpux_os_bug.c:33
(gdb)


Any ideas? Thanks.
6 REPLIES 6
Ron Kinner
Honored Contributor

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

It appears to be a buffer overflow problem. I did an nslookup on 66.106.204.66 and the result is ridiculously long:

Name: thehenrylstimsomcenter-thehenrylstimsomcen-psr1136563.z204-106-66.custo
mer.algx.net
Address: 66.106.204.66

Did you try PHCO 28425?

Ron

Steven Hatley
New Member

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

Thank you. Yeah, trying that now. I hope that's it.
Steven Hatley
New Member

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

Well, that patch didn't help. Still getting the same error, same core footprint. The new libc.2 file is from March 4, wonder if that's the latest? I knew the hostname from that IP looked hideous, but I sure was hoping a quick patch would resolve this. Now, to get the HPUX support team involved...
Mark Greene_1
Honored Contributor

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

running whois at ARIN for the IP returns this as the technical contact:

Data-NOCC@allegiancetelecom.com

You may want to shoot them an e-mail. You would think they realize that the name is a bit redundant. I wonder if it is RFC compliant?

For what it's worth, Linux 7.2 properly resolves the name. I am reluctant to try it on any of our liver servers.


HTH
mark
the future will be a lot like now, only later
James Warren
New Member

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

Here's another ip address which shows the same problem:

67.93.195.10
Rajeev  Shukla
Honored Contributor

Re: gethostbyaddr() can easily core dump using this IP: 66.106.204.66

That is really shocking...
I tried these and nslookup works but when i wrote a program using gethostbyaddr() like this one ..it works for all address except for the address which you have supplied..

#include
#include
#include
#include
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
u_int addr;
struct hostent *hp;
char **p;
if (argc != 2) {
(void) printf("usage: %s IP-address\n",argv[0]);
exit (1);
}
if ((int) (addr = inet_addr (argv[1])) == -1) {
(void) printf("IP-address must be of the form a.b.c.d\n");
exit (2);
}
hp=gethostbyaddr((char *) &addr, sizeof (addr), AF_INET);
if (hp == NULL) {
(void) printf("host information for %s no found \n", argv[1]);
exit (3);
}
for (p = hp->h_addr_list; *p!=0;p++){
struct in_addr in;
char **q;
(void)memcpy(&in.s_addr, *p, sizeof(in.s_addr));
(void)printf("%s\t%s",inet_ntoa(in), hp->h_name);
for (q=hp->h_aliases;*q != 0; q++)
(void) printf("%s", *q);
(void)putchar('\n');
}
exit(0);
}


Rajeev