NetBSD Problem Report #3486

Received: (qmail-queue invoked from smtpd); 14 Apr 1997 01:27:36 -0000
Message-Id: <199704140127.SAA11421@Cup.DSG.Stanford.EDU>
Date: Sun, 13 Apr 1997 18:27:01 -0700 (PDT)
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
Reply-To: jonathan@DSG.Stanford.EDU
To: gnats-bugs@gnats.netbsd.org
Cc: matthew green <mrg@splode.eterna.com.au>
Subject: lib/libc/net/gethostnamadr.c broken
X-Send-Pr-Version: 3.95

>Number:         3486
>Category:       lib
>Synopsis:       gethostnamadr.c broken in bind-4.5.1 import
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    lib-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 13 18:35:01 +0000 1997
>Closed-Date:    Mon Apr 14 01:41:24 +0000 1997
>Last-Modified:  Mon Apr 14 01:56:41 +0000 1997
>Originator:     
>Release:        NetBSD-current supped at 13-Apr-1997
>Organization:
	NetBSD
>Environment:

System: NetBSD Cup.DSG.Stanford.EDU 1.2D NetBSD 1.2D (DSG_4K) #0: Mon Mar 31 20:29:11 PST 1997 jonathan@Cup.DSG.Stanford.EDU:/aga/n1/src/NetBSD/IP-PLUS/src/sys/arch/i386/compile/DSG_4K i386


>Description:

In NetBSD-current with BIND-4.9.1-P1, lots of commands that map a PTR
for 127.0.0.1 to a hostname seem to coredump.

>How-To-Repeat:

	Build  and install -current with the BIND-4.9.1-P1 update
	as of 13-Apr-1997.
	Try "telnet localhost".
	Try "rsh localhost pwd".
	Try "netstat".
	Try "netstat -r".


>Fix:

workaround:
	Use "telnet <hostname>".
	Use "rsh <hostname> pwd".
	Use "netstat -n".
	Use "netstat -nr".


Looking at the coredumps with a debugger shows that the calls to
gethostnamadr.c:getanswer() are inconsistent with the internals of
getanswer(). Getanswer() clearly expects its 3rd arg to be a char*.

The callers are now passing it  a boolean (0 or 1) instead. This is
saved in the local variable "tname" which is again assumed to be a char*.

In some cases, the value 1 gets passed to strcasecmp(), with
predictable lossage.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mrg 
State-Changed-When: Sun Apr 13 18:41:24 PDT 1997 
State-Changed-Why:  
fixed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.