summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_search.c4
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c1
2 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c
index ebbc1a3974..e43125d588 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_search.c
@@ -473,6 +473,10 @@ int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base,
return -1;
}
+ if (tree == NULL) {
+ return -1;
+ }
+
*res = NULL;
ret = ltdb_search_indexed(module, base, scope, tree, attrs, res);
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index 08a8b7f179..f96c14f5ec 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -74,6 +74,7 @@ static int do_search(struct ldb_context *ldb,
req.op.search.base = basedn;
req.op.search.scope = options->scope;
req.op.search.tree = ldb_parse_tree(ldb, expression);
+ if (req.op.search.tree == NULL) return -1;
req.op.search.attrs = attrs;
req.op.search.res = NULL;
req.controls = parse_controls(ldb, options->controls);