SUMMARY: bug in gethostbyname()

From: Joe Habermann (
Date: Mon Feb 24 1992 - 20:19:37 CST

1) Has anyone else seen this?
Yes. Is a Known Bug. Everyone reported exactly the same

2) Is there a patch?
No. It has been reported to Sun, however.

Thanks to all who responded:

* Bede W P Seymour (
  Zhou Shouben (zshouben@PCS.CNC.EDU)
* Hilarie Orman (
  Greg Lindahl (gl8f@fermi.clas.Virginia.EDU)
  Michael Helm (

  * -- have reported bug to Sun

The following is my original query.

Joe Habermann

Newsgroups: info.sun-managers
Subject: bug in gethostbyname()
Summary: Bug in gethostbyname() for hosts w/>10 addrs -- patch avail?
Keywords: DNS hack gethostbyname libc network patch bug

There appears to be a bug in gethostbyname() in SunOS 4.1.{1,2}* (at least.) It goes something like this:

If you are running the makedbm -b/ypserv -i DNS hack, and gethostbyname() is passed a host that has >10 addresses, then the calling program will crash with a segmentation fault if the host is registered with DNS but not under NIS.

For example, 'ypmatch hosts' will successfully return its 17 addresses, but 'ping' will dump core.

1) Has anyone else seen this? 2) Is there a patch?

I am not interested in replies like "use the resolver versions of the get-host-entry routines."

Many thanks,

Joe Habermann --

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:37 CDT