1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-24 21:49:29 +03:00

winbind: avoid using fstrcpy(dcname,...) in _dual_init_connection

domain->dcname was converted from fstring to char * by commit
14bae61ba3.

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 <metze@samba.org>
This commit is contained in:
Stefan Metzmacher
2018-02-15 16:00:33 +01:00
parent b158d4e4c1
commit d73e3d4519

View File

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