summaryrefslogtreecommitdiff
path: root/source4/dsdb/kcc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-28 15:16:06 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-28 15:36:10 +1000
commit4a230b5e6ccbd7e8ac3dce875014715b733bb210 (patch)
tree6ace78a086d9a0aa65e4b317744a808b21a114bc /source4/dsdb/kcc
parent0b0edbb606eb291b293e1bd0f3adfbbe76318d89 (diff)
downloadsamba-4a230b5e6ccbd7e8ac3dce875014715b733bb210.tar.gz
samba-4a230b5e6ccbd7e8ac3dce875014715b733bb210.tar.bz2
samba-4a230b5e6ccbd7e8ac3dce875014715b733bb210.zip
s4-kcc: fixed corruption of repsFrom records by kcc
We were re-using a stack variable outside of the stack scope
Diffstat (limited to 'source4/dsdb/kcc')
-rw-r--r--source4/dsdb/kcc/kcc_periodic.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c
index dfbbf2404b..44e0c7ae8b 100644
--- a/source4/dsdb/kcc/kcc_periodic.c
+++ b/source4/dsdb/kcc/kcc_periodic.c
@@ -132,7 +132,6 @@ static NTSTATUS kccsrv_simple_update(struct kccsrv_service *s, TALLOC_CTX *mem_c
for (i=0; i<res->count; i++) {
struct repsFromTo1 *r1;
- struct repsFromTo1OtherInfo oi;
struct GUID ntds_guid, invocation_id;
ntds_guid = samdb_result_guid(res->msgs[i], "objectGUID");
@@ -147,14 +146,13 @@ static NTSTATUS kccsrv_simple_update(struct kccsrv_service *s, TALLOC_CTX *mem_c
NT_STATUS_HAVE_NO_MEMORY(reps);
ZERO_STRUCT(reps[count]);
- ZERO_STRUCT(oi);
reps[count].version = 1;
r1 = &reps[count].ctr.ctr1;
- oi.dns_name = talloc_asprintf(mem_ctx, "%s._msdcs.%s",
+ r1->other_info = talloc_zero(reps, struct repsFromTo1OtherInfo);
+ r1->other_info->dns_name = talloc_asprintf(r1->other_info, "%s._msdcs.%s",
GUID_string(mem_ctx, &ntds_guid),
lp_realm(s->task->lp_ctx));
- r1->other_info = &oi;
r1->source_dsa_obj_guid = ntds_guid;
r1->source_dsa_invocation_id = invocation_id;
r1->replica_flags =