From d9bf88dc749cdbc34f70345b156b0117ecf2932b Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Tue, 17 Sep 2013 22:14:20 -0700 Subject: Fix SEGV from improperly formed SUBSTRING/PRESENCE filter Signed-off-by: Howard Chu Reviewed-by: Simo Sorce Reviewed-by: Volker Lendecke Reviewed-by: Michael Adam Autobuild-User(master): Michael Adam Autobuild-Date(master): Thu Sep 19 01:42:43 CEST 2013 on sn-devel-104 --- lib/ldb/ldb_map/ldb_map_outbound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/ldb') diff --git a/lib/ldb/ldb_map/ldb_map_outbound.c b/lib/ldb/ldb_map/ldb_map_outbound.c index c6c86e326a..5be5e76515 100644 --- a/lib/ldb/ldb_map/ldb_map_outbound.c +++ b/lib/ldb/ldb_map/ldb_map_outbound.c @@ -848,7 +848,7 @@ int map_subtree_collect_remote_simple(struct ldb_module *module, void *mem_ctx, int i; /* Map value */ (*new)->u.substring.chunks = NULL; - for (i=0; tree->u.substring.chunks[i]; i++) { + for (i=0; tree->u.substring.chunks && tree->u.substring.chunks[i]; i++) { (*new)->u.substring.chunks = talloc_realloc(*new, (*new)->u.substring.chunks, struct ldb_val *, i+2); if (!(*new)->u.substring.chunks) { talloc_free(*new); -- cgit