[Bug 1921] New: gethostbyaddr does not fill in address

bugzilla at busybox.net bugzilla at busybox.net
Thu Jun 3 05:01:12 UTC 2010


           Summary: gethostbyaddr does not fill in address
           Product: uClibc
           Version: 0.9.31
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at uclibc.org
        ReportedBy: michael at talamasca.ocis.net
                CC: uclibc-cvs at uclibc.org
   Estimated Hours: 0.0

Created attachment 1873
  --> https://bugs.busybox.net/attachment.cgi?id=1873
Patch to fix gethostbyaddr() problem

gethostbyaddr returns a garbage address in the slot pointed to by h_addr_list. 
This is a regression from

While it is rather daft to do a gethostbyaddr lookup and then use that value
(which is supposed to be the same as what was put in), NcFTP client is so
perverted.  On an unpatched uClibc-0.9.31, it will appear to fail to connect to
any host; what is really happening is that it is trying to open ftp connections
to [].

It appears the problem is a stray & operator in one line.  This causes the
original address to be stored not in the intended slot, but over the pointer to
that slot.  (In the IPv6 case, it appears stack corruption would also result.)

A fix is attached.

Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the uClibc-cvs mailing list