Skip to content

Commit

Permalink
winbind: avoid using fstrcpy(dcname,...) in _dual_init_connection
Browse files Browse the repository at this point in the history
domain->dcname was converted from fstring to char * by commit
14bae61.

Luckily this was only ever called with an empty string in
state->request->data.init_conn.dcname.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13294

Signed-off-by: Stefan Metzmacher <[email protected]>
  • Loading branch information
metze-samba committed Feb 23, 2018
1 parent b158d4e commit d73e3d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion source3/winbindd/winbindd_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,12 @@ enum winbindd_result winbindd_dual_init_connection(struct winbindd_domain *domai
[sizeof(state->request->data.init_conn.dcname)-1]='\0';

if (strlen(state->request->data.init_conn.dcname) > 0) {
fstrcpy(domain->dcname, state->request->data.init_conn.dcname);
TALLOC_FREE(domain->dcname);
domain->dcname = talloc_strdup(domain,
state->request->data.init_conn.dcname);
if (domain->dcname == NULL) {
return WINBINDD_ERROR;
}
}

init_dc_connection(domain, false);
Expand Down

0 comments on commit d73e3d4

Please sign in to comment.