From ab6a39fa4f6442412f3629c4b9b64feeb1e32b19 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 1 Feb 2006 20:48:05 +0000 Subject: r13289: Check the tree is not NULL Thanks to Aaron J. Seigo for spotting this (This used to be commit 4b5c0493e2276a9eba1bada7c4bac99999a465e2) --- source4/lib/ldb/ldb_tdb/ldb_search.c | 4 ++++ source4/lib/ldb/tools/ldbsearch.c | 1 + 2 files changed, 5 insertions(+) (limited to 'source4/lib/ldb') 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); -- cgit