summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2013-09-17 22:14:20 -0700
committerKarolin Seeger <kseeger@samba.org>2014-07-15 12:46:13 +0200
commitc257bc6ccd156d84be907304a065e496c38fedb7 (patch)
tree2d2db16ed8e06072a1c3fcce92f5afd7ec040010 /lib/ldb
parent3d932b0742390079e3a0b6230714a2e3d07485f3 (diff)
downloadsamba-c257bc6ccd156d84be907304a065e496c38fedb7.tar.gz
Fix SEGV from improperly formed SUBSTRING/PRESENCE filter
Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Simo Sorce <idra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Sep 19 01:42:43 CEST 2013 on sn-devel-104 (cherry picked from commit d9bf88dc749cdbc34f70345b156b0117ecf2932b)
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/ldb_map/ldb_map_outbound.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ldb/ldb_map/ldb_map_outbound.c b/lib/ldb/ldb_map/ldb_map_outbound.c
index c6c86e326a8..5be5e765158 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);