From 30ff229a3e32549073424b423302e976c988d563 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 8 Mar 2010 11:43:40 +0100 Subject: s4:LDB TDB index code - reintroduce accidentally removed code part This was removed by 95d726f3018ef5d249f89d56bde24b7ee0c24ecf. Sorry. --- source4/lib/ldb/ldb_tdb/ldb_index.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/lib') diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index c9c3e0c211..828dca1f2c 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -1331,7 +1331,9 @@ int ltdb_index_del_value(struct ldb_module *module, struct ldb_dn *dn, } j = (unsigned int) i; - memmove(&list->dn[j], &list->dn[j+1], sizeof(list->dn[0])*(list->count - (i+1))); + if (j != list->count - 1) { + memmove(&list->dn[j], &list->dn[j+1], sizeof(list->dn[0])*(list->count - (j+1))); + } list->count--; list->dn = talloc_realloc(list, list->dn, struct ldb_val, list->count); -- cgit