summaryrefslogtreecommitdiff
path: root/source3/libads/ldap.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2016-03-11 12:15:14 +0100
committerStefan Metzmacher <metze@samba.org>2016-03-14 16:19:23 +0100
commitc61b111e6fa3e138d4d9cf5038b69644248e834a (patch)
treed94a361ecbbb92b7115a10bb5041a70f8ee627c6 /source3/libads/ldap.c
parente8f6acdeece990dc8953d494113dee856d80da45 (diff)
downloadsamba-c61b111e6fa3e138d4d9cf5038b69644248e834a.tar.gz
s3:libads:ldap: fix ads_check_ou_dn to deal with account_ou not being initialized
Guenther BUG: https://bugzilla.samba.org/show_bug.cgi?id=11755 Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r--source3/libads/ldap.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 22725e1731f..10cdae49d0c 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -3941,10 +3941,16 @@ ADS_STATUS ads_check_ou_dn(TALLOC_CTX *mem_ctx,
const char *name;
char *ou_string;
- exploded_dn = ldap_explode_dn(*account_ou, 0);
- if (exploded_dn) {
- ldap_value_free(exploded_dn);
- return ADS_SUCCESS;
+ if (account_ou == NULL) {
+ return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER);
+ }
+
+ if (*account_ou != NULL) {
+ exploded_dn = ldap_explode_dn(*account_ou, 0);
+ if (exploded_dn) {
+ ldap_value_free(exploded_dn);
+ return ADS_SUCCESS;
+ }
}
ou_string = ads_ou_string(ads, *account_ou);