summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2014-07-24 15:54:58 +1200
committerAndrew Bartlett <abartlet@samba.org>2014-08-01 09:48:35 +0200
commit36ecbf34ba7fd5d46118bd3403128155c47ea1fd (patch)
treeb4b8f2cfe20ca0ae9c1aa4df85db546be5b9f665 /libcli
parent95d1828a248148d6f45aafc134ccb4aebfef7226 (diff)
downloadsamba-36ecbf34ba7fd5d46118bd3403128155c47ea1fd.tar.gz
libcli/auth: Ensure that the dns_names in/out parameter is preserved
This is in dcerpc_netr_DsrUpdateReadOnlyServerDnsRecords, which has status variables filled in by the server and placed in this in/out array. This showed up as a segfault in winbindd during RODC DNS update. Andrew Bartlett Signed-off-by: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/auth/netlogon_creds_cli.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcli/auth/netlogon_creds_cli.c b/libcli/auth/netlogon_creds_cli.c
index d709e6a7b3d..a461dc600dd 100644
--- a/libcli/auth/netlogon_creds_cli.c
+++ b/libcli/auth/netlogon_creds_cli.c
@@ -2754,7 +2754,14 @@ static void netlogon_creds_cli_DsrUpdateReadOnlyServerDnsRecords_done(struct tev
NTSTATUS result;
bool ok;
- status = dcerpc_netr_DsrUpdateReadOnlyServerDnsRecords_recv(subreq, state,
+ /*
+ * We use state->dns_names as the memory context, as this is
+ * the only in/out variable and it has been overwritten by the
+ * out parameter from the server.
+ *
+ * We need to preserve the return value until the caller can use it.
+ */
+ status = dcerpc_netr_DsrUpdateReadOnlyServerDnsRecords_recv(subreq, state->dns_names,
&result);
TALLOC_FREE(subreq);
if (tevent_req_nterror(req, status)) {