summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 3 insertions, 1 deletions
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);