diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-15 17:39:14 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-11-05 00:10:41 +0100 |
commit | 9a51f72efd8bc36d7ece97b692f409799d4aac03 (patch) | |
tree | 301403d5816b5ff0f0d4460b909eba984b76984e | |
parent | e5c33e0bd03a2deb8e5011deeb3ae93f960910ee (diff) | |
download | sssd-9a51f72efd8bc36d7ece97b692f409799d4aac03.tar.gz sssd-9a51f72efd8bc36d7ece97b692f409799d4aac03.tar.xz sssd-9a51f72efd8bc36d7ece97b692f409799d4aac03.zip |
LDAP: Check validity of naming_context
https://fedorahosted.org/sssd/ticket/1581
If the namingContext attribute had no values or multiple values, then
our code would dereference a NULL pointer.
-rw-r--r-- | src/providers/ldap/sdap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c index cdc8b1f18..f5b1f95f0 100644 --- a/src/providers/ldap/sdap.c +++ b/src/providers/ldap/sdap.c @@ -746,7 +746,7 @@ static char *get_naming_context(TALLOC_CTX *mem_ctx, * 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') { + if (naming_context && naming_context[0] == '\0') { talloc_zfree(naming_context); } |