[PATCH] s3-winbind: Fix a segfault passing NULL to a fstring argument.

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Aug 13 03:01:15 MDT 2013


On Tue, Aug 13, 2013 at 08:37:22AM +0200, Andreas Schneider wrote:
> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10082
> Signed-off-by: Andreas Schneider <asn at samba.org>
> ---
>  source3/winbindd/winbindd_cm.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
> index 6c3f6ea..08c763c 100644
> --- a/source3/winbindd/winbindd_cm.c
> +++ b/source3/winbindd/winbindd_cm.c
> @@ -1127,6 +1127,7 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
>  	uint32_t nt_version = NETLOGON_NT_VERSION_1;
>  	NTSTATUS status;
>  	const char *dc_name;
> +	fstring nbtname;
>  
>  	ip_list.ss = *pss;
>  	ip_list.port = 0;
> @@ -1210,9 +1211,17 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
>  
>  	/* try node status request */
>  
> -	if (name_status_find(domain->name, 0x1c, 0x20, pss, *name) ) {
> +	if (name_status_find(domain->name, 0x1c, 0x20, pss, nbtname) ) {
>  		namecache_store(*name, 0x20, 1, &ip_list);
> -		return True;
> +
> +		if (name != NULL) {
> +			*name = talloc_strdup(mem_ctx, nbtname);
> +			if (*name == NULL) {
> +				return false;
> +			}
> +		}
> +
> +		return true;
>  	}
>  	return False;
>  }

Reviewed-by: Volker Lendecke <vl at samba.org>

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de


More information about the samba-technical mailing list