Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Jul 2000 22:22:58 -0700 (PDT)
From:      Bill Fenner <fenner@research.att.com>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/19816: getnameinfo() dumps core on 131.118.32.4
Message-ID:  <200007100522.WAA15748@fenestro.attlabs.att.com>

next in thread | raw e-mail | index | archive | help

>Number:         19816
>Category:       bin
>Synopsis:       getnameinfo() dumps core on 131.118.32.4
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 09 22:30:03 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bill Fenner
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
AT&T Labs - Research
>Environment:

	

>Description:

	
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().

>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);
}


>Fix:

	
Unknown.
Workaround: don't try to look up this IP address using getnameinfo().


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200007100522.WAA15748>