mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
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.
This commit is contained in:
parent
5c016ad88e
commit
a56ede9027
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user