Subject: ypbind bug ?
To: None <tech-userlevel@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-userlevel
Date: 10/12/2003 13:29:26
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
while looking at the ypbind source code, I found that ypbind uses a struct
member which is never initialised.
This is dom_server_port from struct _dom_binding. The server port is available
in the dom_server_addr sockaddr_in. dom_server_port is used once in
ypbindproc_domain_2(); the debug printf below its uses dom_server_addr.sin_port.
Did I miss sometheing ?
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 24 ans d'experience feront toujours la difference
--
--T4sUOijqQbZv57TR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=ypbind
Index: ypbind.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/ypbind/ypbind.c,v
retrieving revision 1.46
diff -u -r1.46 ypbind.c
--- ypbind.c 2001/02/19 23:22:50 1.46
+++ ypbind.c 2003/10/12 11:23:03
@@ -90,7 +90,6 @@
struct _dom_binding *dom_pnext;
char dom_domain[YPMAXDOMAIN + 1];
struct sockaddr_in dom_server_addr;
- unsigned short int dom_server_port;
int dom_socket;
CLIENT *dom_client;
long dom_vers;
@@ -338,7 +337,7 @@
res.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr.s_addr =
ypdb->dom_server_addr.sin_addr.s_addr;
res.ypbind_respbody.ypbind_bindinfo.ypbind_binding_port =
- ypdb->dom_server_port;
+ ypdb->dom_server_addr.sin_port;
#ifdef DEBUG
if (debug)
printf("domain %s at %s/%d\n", ypdb->dom_domain,
--T4sUOijqQbZv57TR--