[Bug 4916] New: gethostbyname fails with Segmentation fault in special conditions

bugzilla at busybox.net bugzilla at busybox.net
Tue Mar 13 21:31:25 UTC 2012


https://bugs.busybox.net/show_bug.cgi?id=4916

           Summary: gethostbyname fails with Segmentation fault in special
                    conditions
           Product: uClibc
           Version: 0.9.32.1
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at uclibc.org
        ReportedBy: perfectflow at mail.ru
                CC: uclibc-cvs at uclibc.org
   Estimated Hours: 0.0


Buildroot with uClibc 0.9.33, i386/i586, optimized by size, gcc 4.4.6

How to reproduce:
1) add long string into /etc/hosts. For example:
##############################################################################

2) compile and run this test:
--------------------------------------
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>

int main(void)
{
    int i;
    struct hostent *h;

    for(i=1;i<100;i++)
    {
        printf("i=%i\n",i);
        h = gethostbyname( "aaaaaaaaaaaaaaaaaaaaa.com");
    }    

}
--------------------------------------

3) Run it, usually it fails with:

i=1
i=2
Segmentation fault

-- 
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