summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-25 13:12:32 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-25 13:15:18 +1100
commit2eca02a4080b68fbb2dacb659b1733224cfa462e (patch)
tree5cb6ddbda3f0da587e02b228ca08cfec2b120723 /source4/lib/ldb
parentc34e45a8e2880eb06be6425fa6be15246db03197 (diff)
downloadsamba-2eca02a4080b68fbb2dacb659b1733224cfa462e.tar.gz
samba-2eca02a4080b68fbb2dacb659b1733224cfa462e.tar.bz2
samba-2eca02a4080b68fbb2dacb659b1733224cfa462e.zip
s4-ldb: fixed string length handling on index records
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 9faba397d0..5002de527b 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -312,7 +312,7 @@ static int ltdb_index_traverse_store(struct tdb_context *tdb, TDB_DATA key, TDB_
}
v.data = key.dptr;
- v.length = key.dsize;
+ v.length = strnlen((char *)key.dptr, key.dsize);
dn = ldb_dn_from_ldb_val(module, ldb, &v);
if (dn == NULL) {
@@ -1417,7 +1417,7 @@ static int delete_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, vo
list.dn = NULL;
list.count = 0;
v.data = key.dptr;
- v.length = strlen((char *)key.dptr);
+ v.length = strnlen((char *)key.dptr, key.dsize);
dn = ldb_dn_from_ldb_val(ltdb, ldb_module_get_ctx(module), &v);
ret = ltdb_dn_list_store(module, dn, &list);