summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-05-24 12:33:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:33 -0500
commitb22d15a0f80be0de1bb123f79058ec85d083cd75 (patch)
treebabdad8ea7f085dc5ef80236885c04bf9f0cf4f8 /source4
parent9ff4fcab36aac36dc4b02cb218811ec8d8dc15d3 (diff)
downloadsamba-b22d15a0f80be0de1bb123f79058ec85d083cd75.tar.gz
samba-b22d15a0f80be0de1bb123f79058ec85d083cd75.tar.bz2
samba-b22d15a0f80be0de1bb123f79058ec85d083cd75.zip
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)
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/password_hash.c5
1 files changed, 4 insertions, 1 deletions
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);