From 1a7898e3a8f2c2e2cacd645b97da88054df931ae Mon Sep 17 00:00:00 2001 From: Kumar Thangavelu Date: Fri, 29 May 2009 11:27:38 +0200 Subject: [PATCH] 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 --- source3/libsmb/dsgetdcname.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c index 5606b8e..fb87b4d 100644 --- a/source3/libsmb/dsgetdcname.c +++ b/source3/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 */ -- 1.6.0.2