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.
This commit is contained in:
Simo Sorce
2012-05-29 17:41:38 -04:00
parent 51bd68eaf5
commit 43701d2735

View File

@@ -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));