Subject: Re: pkg/16683: [net/bind8] libbind has a small bug (may crash)
To: None <iseki@gongon.com>
From: Takahiro Kambe <taca@sky.yamashina.kyoto.jp>
List: netbsd-bugs
Date: 05/08/2002 23:59:57
In message <20020506022939.000DF1112F@www.netbsd.org>
	on Sun,  5 May 2002 19:29:39 -0700 (PDT),
	iseki@gongon.com wrote:
> The bug is reproduced NetBSD's telnet with libbind of BIND version
> 8.3.1.
> >Fix:
>     src/lib/irs/getaddrinfo.c:323
>         -	struct addrinfo ai, ai0, *afai;
>         +	struct addrinfo ai, ai0, *afai = 0;  /* fine work */

"afai"'s value will set later at line 496.

	error = explore_fqdn(pai, hostname, servname, &afai);

How about make explore_fqdn() always set last argument?

--- lib/irs/getaddrinfo.c.orig	Fri Nov 30 09:36:54 2001
+++ lib/irs/getaddrinfo.c	Wed May  8 23:55:34 2002
@@ -602,7 +602,7 @@ explore_fqdn(pai, hostname, servname, re
 	char tmp[NS_MAXDNAME];
 	const char *cp;
 
-	result = NULL;
+	*res = NULL;
 
 	/*
 	 * if the servname does not match socktype/protocol, ignore it.

--
Takahiro Kambe <taca@sky.yamashina.kyoto.jp>