summaryrefslogtreecommitdiff
path: root/lib/ldb/common
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-06-15 16:00:42 +1000
committerAndrew Bartlett <abartlet@samba.org>2013-06-22 09:33:14 +0200
commit0ee8650d778736a130e914df9e14734ef18e0fb5 (patch)
treeb2f25c5b69cce2068c63e11ba1615180a841703c /lib/ldb/common
parentbbe09b3319630a3892e2350dace86d6953b0ae3d (diff)
downloadsamba-0ee8650d778736a130e914df9e14734ef18e0fb5.tar.gz
samba-0ee8650d778736a130e914df9e14734ef18e0fb5.tar.bz2
samba-0ee8650d778736a130e914df9e14734ef18e0fb5.zip
ldb: Ensure not to segfault on a filter such as (mail=)
As reported by Robin McCorkell <xenopathic@gmail.com> triggered by Mozilla Thunderbird as an LDAP client. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Matthieu Patou <mat@matws.net> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Jun 22 09:33:14 CEST 2013 on sn-devel-104
Diffstat (limited to 'lib/ldb/common')
-rw-r--r--lib/ldb/common/ldb_match.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ldb/common/ldb_match.c b/lib/ldb/common/ldb_match.c
index 5eee02dea3..7918aec65f 100644
--- a/lib/ldb/common/ldb_match.c
+++ b/lib/ldb/common/ldb_match.c
@@ -249,6 +249,11 @@ static int ldb_wildcard_compare(struct ldb_context *ldb,
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
}
+ if (tree->u.substring.chunks == NULL) {
+ *matched = false;
+ return LDB_SUCCESS;
+ }
+
if (a->syntax->canonicalise_fn(ldb, ldb, &value, &val) != 0) {
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
}