diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-15 17:39:14 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-15 17:59:11 +0200 |
commit | f2c39d4869da56268726f6e8fc224de8cecb7336 (patch) | |
tree | fa1e1ac57a8254768c1cb6a67be511ab3e57c5a4 /src | |
parent | 8529b5fe0177c8f68aa7e4a90629f82b34098abc (diff) | |
download | sssd-f2c39d4869da56268726f6e8fc224de8cecb7336.tar.gz sssd-f2c39d4869da56268726f6e8fc224de8cecb7336.tar.bz2 sssd-f2c39d4869da56268726f6e8fc224de8cecb7336.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.
Diffstat (limited to 'src')
-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 cdc8b1f1..f5b1f95f 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); } |