From b22d15a0f80be0de1bb123f79058ec85d083cd75 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 24 May 2006 12:33:06 +0000 Subject: r15859: fixed a crash bug in the ldb password_hash module. This one is quite sublte - please have a look at the change if you are not certain you know the semantics of constant arrays declared on the stack (they must be static if you return them from the function) (This used to be commit 1848078fee2041195e3d65fcc090d7b6330b8ea0) --- source4/dsdb/samdb/ldb_modules/password_hash.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/samdb/ldb_modules/password_hash.c') diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c b/source4/dsdb/samdb/ldb_modules/password_hash.c index 1a2ca629bc..2885fb82a2 100644 --- a/source4/dsdb/samdb/ldb_modules/password_hash.c +++ b/source4/dsdb/samdb/ldb_modules/password_hash.c @@ -1145,7 +1145,10 @@ static int get_domain_data_callback(struct ldb_context *ldb, void *context, stru static int build_domain_data_request(struct ph_async_context *ac, struct dom_sid *sid) { - const char * const attrs[] = { "pwdProperties", "pwdHistoryLength", "dnsDomain", NULL }; + /* attrs[] is returned from this function in + ac->dom_req->op.search.attrs, so it must be static, as + otherwise the compiler can put it on the stack */ + static const char * const attrs[] = { "pwdProperties", "pwdHistoryLength", "dnsDomain", NULL }; char *filter; ac->dom_req = talloc_zero(ac, struct ldb_request); -- cgit