summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-01-16 08:58:27 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-16 09:34:27 +1100
commita56ede9027125aa9e70358661b2db1e9f993e939 (patch)
tree38e13a45d832ffd631ffe5423d1503c90f278cbd /source4/lib
parent5c016ad88e366db31e78db885b3a6edcbdec1e0c (diff)
downloadsamba-a56ede9027125aa9e70358661b2db1e9f993e939.tar.gz
samba-a56ede9027125aa9e70358661b2db1e9f993e939.tar.bz2
samba-a56ede9027125aa9e70358661b2db1e9f993e939.zip
s4-ldb: cope with bad ptr alignment in ldb_index.c
We can't assume that a rec_ptr will come back from a tdb traverse with alignment sufficient for a pointer.
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 01d0d6ce34..4b31021001 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -103,12 +103,12 @@ static struct dn_list *ltdb_index_idxptr(struct ldb_module *module, TDB_DATA rec
"Bad data size for idxptr %u", (unsigned)rec.dsize);
return NULL;
}
-
- list = talloc_get_type(*(struct dn_list **)rec.dptr, struct dn_list);
+ memcpy(&list, rec.dptr, sizeof(void *));
+ list = talloc_get_type(list, struct dn_list);
if (list == NULL) {
ldb_asprintf_errstring(ldb_module_get_ctx(module),
"Bad type '%s' for idxptr",
- talloc_get_name(*(struct dn_list **)rec.dptr));
+ talloc_get_name(list));
return NULL;
}
if (check_parent && list->dn && talloc_parent(list->dn) != list) {