Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Feb 1996 22:41:29 +0000 (GMT)
From:      Adam David <adam@veda.is>
To:        wpaul@ctr.columbia.edu (Bill Paul)
Cc:        current@freebsd.org
Subject:   Re: ypserv: ypproc_master
Message-ID:  <199602292241.WAA03149@veda.is>
In-Reply-To: <199602292052.PAA08014@startide.ctr.columbia.edu> from Bill Paul at "Feb 29, 96 03:52:57 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
> Hmm. Odd: I can't seem to trip the bug on my development box. Even so,
> you're probably right about the NULL (or in this case, uninitialized)
> string.

It only shows up when yp_access() denies access, or if some other error occurs
before the master server name is determined.

> *** 1.3	1996/02/26 02:23:39
> --- yp_server.c	1996/02/29 19:57:12
> ***************
> *** 532,537 ****
> --- 532,539 ----
>   	static ypresp_master  result;
>   	DBT key,data;
>   
> + 	result.peer = "";
> + 

> Initializing the 'peer' member of the result to an empty string should
> be enough to pacify the XDR filters.

Yes, it cures the SEGV.

In rpc.yppasswdd however, ypxfr_get_master() frees the string sent in response,
so it would seem better to have sent a malloc'd string in the first place.

--
Adam David <adam@veda.is>



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