From: Kumar Thangavelu Date: Fri, 29 May 2009 09:27:38 +0000 (+0200) Subject: s3/getdcname: Fix 'net' crash. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30cca93674d0dad15ad0ccfaf0d81f94d7d17b4a;p=thirdparty%2Fsamba.git s3/getdcname: Fix 'net' crash. 'net' command crashed when attempting to join a domain. This occurred in a very specific case where the DC had multiple IPs and one of the IPs was invalid. Signed-off-by: Volker Lendecke Fixes bug #6420. --- diff --git a/source/libsmb/dsgetdcname.c b/source/libsmb/dsgetdcname.c index 77c2dcfac42..714c11b5dd6 100644 --- a/source/libsmb/dsgetdcname.c +++ b/source/libsmb/dsgetdcname.c @@ -626,8 +626,8 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx, struct ip_service_name *r = &dclist[count]; - r->port = dcs[count].port; - r->hostname = dcs[count].hostname; + r->port = dcs[i].port; + r->hostname = dcs[i].hostname; /* If we don't have an IP list for a name, lookup it up */