summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers/ldap/sdap.c')
-rw-r--r--src/providers/ldap/sdap.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index 9e052eef5..be80e51c3 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -705,6 +705,14 @@ static char *get_naming_context(TALLOC_CTX *mem_ctx,
}
}
+ /* Some directory servers such as Novell eDirectory will return
+ * a zero-length namingContexts value in some situations. In this
+ * case, we should return it as NULL so things fail gracefully.
+ */
+ if (naming_context[0] == '\0') {
+ talloc_zfree(naming_context);
+ }
+
return naming_context;
}