From: Günther Deschner Date: Wed, 21 Dec 2011 14:47:35 +0000 (+0100) Subject: s3-dns: prevent from potentially doing wrong SRV DNS lookups. X-Git-Url: http://git.samba.org/?p=mat%2Fsamba.git;a=commitdiff_plain;h=bfbb3893325b0a0a47d49c3a1ad83f047f42e361 s3-dns: prevent from potentially doing wrong SRV DNS lookups. With an empty sitename we asked for e.g. _ldap._tcp.._sites.dc._msdcs.AD.EXAMPLE.COM Guenther Autobuild-User: Günther Deschner Autobuild-Date: Wed Dec 21 17:23:25 CET 2011 on sn-devel-104 --- diff --git a/source3/libads/dns.c b/source3/libads/dns.c index 5eae10ec28..39454fcebc 100644 --- a/source3/libads/dns.c +++ b/source3/libads/dns.c @@ -756,7 +756,7 @@ static NTSTATUS ads_dns_query_internal(TALLOC_CTX *ctx, int *numdcs ) { char *name; - if (sitename) { + if (sitename && strlen(sitename)) { name = talloc_asprintf(ctx, "%s._tcp.%s._sites.%s._msdcs.%s", servicename, sitename, dc_pdc_gc_domains, realm);