From 0ee8650d778736a130e914df9e14734ef18e0fb5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Sat, 15 Jun 2013 16:00:42 +1000 Subject: ldb: Ensure not to segfault on a filter such as (mail=) As reported by Robin McCorkell triggered by Mozilla Thunderbird as an LDAP client. Andrew Bartlett Signed-off-by: Andrew Bartlett Reviewed-by: Matthieu Patou Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Jun 22 09:33:14 CEST 2013 on sn-devel-104 --- lib/ldb/common/ldb_match.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/ldb') 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; } -- cgit