svn commit: samba r15859 - in branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .

tridge at samba.org tridge at samba.org
Wed May 24 12:33:06 GMT 2006


Author: tridge
Date: 2006-05-24 12:33:06 +0000 (Wed, 24 May 2006)
New Revision: 15859

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15859

Log:

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)

Modified:
   branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c


Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c	2006-05-24 11:46:19 UTC (rev 15858)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/password_hash.c	2006-05-24 12:33:06 UTC (rev 15859)
@@ -1145,7 +1145,10 @@
 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);



More information about the samba-cvs mailing list