From 43701d273525b01fd7a0f3611166653218daf11d Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 29 May 2012 17:41:38 -0400 Subject: Fix setting domain_sid 'sid' is a stack variable, by assigning its address to the domain_sid pointer we were later referencing grabage (whatever on the stack ha[ppened to be at that address. Properly copy the sid and allocate it on the provided memory context. --- daemons/ipa-kdb/ipa_kdb_mspac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'daemons/ipa-kdb') diff --git a/daemons/ipa-kdb/ipa_kdb_mspac.c b/daemons/ipa-kdb/ipa_kdb_mspac.c index c59dcbb32..bb05dce98 100644 --- a/daemons/ipa-kdb/ipa_kdb_mspac.c +++ b/daemons/ipa-kdb/ipa_kdb_mspac.c @@ -415,7 +415,7 @@ static krb5_error_code ipadb_fill_info3(struct ipadb_context *ipactx, } /* we got the domain SID for the user sid */ - info3->base.domain_sid = &sid; + info3->base.domain_sid = talloc_memdup(memctx, &sid, sizeof(sid)); /* always zero out, not used for Krb, only NTLM */ memset(&info3->base.LMSessKey, '\0', sizeof(info3->base.key)); -- cgit