summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-10-15 17:39:14 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-01-29 11:18:07 +0100
commitf0d75718880a0e3a9bc6de185951e94817f59510 (patch)
tree8642c4cb4b882e0048597d745d33bb8f9b5379f7 /src
parent4705c770ae6d8817503431fccfad71f6e3ec88a6 (diff)
downloadsssd-f0d75718880a0e3a9bc6de185951e94817f59510.tar.gz
sssd-f0d75718880a0e3a9bc6de185951e94817f59510.tar.xz
sssd-f0d75718880a0e3a9bc6de185951e94817f59510.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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap.c b/src/providers/ldap/sdap.c
index be80e51c3..c2dccb11d 100644
--- a/src/providers/ldap/sdap.c
+++ b/src/providers/ldap/sdap.c
@@ -709,7 +709,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);
}