diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-15 17:39:14 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-10-15 18:00:03 +0200 |
commit | 78fb6ec085ba14e513361e42ed9285888ac319e3 (patch) | |
tree | 7361c4123fa8936d3b3f28ff34334f669c39eb41 /src/providers/ldap/sdap.c | |
parent | 6b73e69f5d04b85c7326850e51bee55dc0b52ffa (diff) | |
download | sssd-78fb6ec085ba14e513361e42ed9285888ac319e3.tar.gz sssd-78fb6ec085ba14e513361e42ed9285888ac319e3.tar.xz sssd-78fb6ec085ba14e513361e42ed9285888ac319e3.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/providers/ldap/sdap.c')
-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); } |