summaryrefslogtreecommitdiffstats
path: root/source3/libads/cldap.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads/cldap.c')
-rw-r--r--source3/libads/cldap.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/libads/cldap.c b/source3/libads/cldap.c
index 11c083a56a7..f67372805f3 100644
--- a/source3/libads/cldap.c
+++ b/source3/libads/cldap.c
@@ -115,10 +115,12 @@ static int send_cldap_netlogon(int sock, const char *domain,
asn1_write_BOOLEAN2(&data, False);
asn1_push_tag(&data, ASN1_CONTEXT(0));
- asn1_push_tag(&data, ASN1_CONTEXT(3));
- asn1_write_OctetString(&data, "DnsDomain", 9);
- asn1_write_OctetString(&data, domain, strlen(domain));
- asn1_pop_tag(&data);
+ if (domain) {
+ asn1_push_tag(&data, ASN1_CONTEXT(3));
+ asn1_write_OctetString(&data, "DnsDomain", 9);
+ asn1_write_OctetString(&data, domain, strlen(domain));
+ asn1_pop_tag(&data);
+ }
asn1_push_tag(&data, ASN1_CONTEXT(3));
asn1_write_OctetString(&data, "Host", 4);