summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-03-26 19:18:08 +0100
committerGünther Deschner <gd@samba.org>2008-03-26 19:18:08 +0100
commit63b49e1f6e166f9a884fed810294bdc3f0b8c0d2 (patch)
treea7ce829ab81ad27ad811efd7a75091c3f0db6d11 /source3
parent6e026fff3f21284fa28144b66cc050deeae759aa (diff)
downloadsamba-63b49e1f6e166f9a884fed810294bdc3f0b8c0d2.tar.gz
samba-63b49e1f6e166f9a884fed810294bdc3f0b8c0d2.tar.bz2
samba-63b49e1f6e166f9a884fed810294bdc3f0b8c0d2.zip
Fix _netr_LogonControl2(). Return talloced dcname.
Guenther (This used to be commit 42971b71acec9c9fd94011c06d41702dac6b4f87)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_netlog_nt.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_netlog_nt.c b/source3/rpc_server/srv_netlog_nt.c
index 5b26f55845..f4967dc548 100644
--- a/source3/rpc_server/srv_netlog_nt.c
+++ b/source3/rpc_server/srv_netlog_nt.c
@@ -136,7 +136,8 @@ WERROR _netr_LogonControl2(pipes_struct *p,
uint32 pdc_connection_status = 0x0;
uint32 logon_attempts = 0x0;
uint32 tc_status;
- fstring dc_name, dc_name2;
+ fstring dc_name2;
+ const char *dc_name = NULL;
struct sockaddr_storage dc_ss;
const char *domain = NULL;
struct netr_NETLOGON_INFO_1 *info1;
@@ -144,7 +145,6 @@ WERROR _netr_LogonControl2(pipes_struct *p,
struct netr_NETLOGON_INFO_3 *info3;
tc_status = W_ERROR_V(WERR_NO_SUCH_DOMAIN);
- fstrcpy( dc_name, "" );
switch (r->in.function_code) {
case NETLOGON_CONTROL_TC_QUERY:
@@ -158,7 +158,10 @@ WERROR _netr_LogonControl2(pipes_struct *p,
break;
}
- fstr_sprintf( dc_name, "\\\\%s", dc_name2 );
+ dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
+ if (!dc_name) {
+ return WERR_NOMEM;
+ }
tc_status = W_ERROR_V(WERR_OK);
@@ -175,7 +178,10 @@ WERROR _netr_LogonControl2(pipes_struct *p,
break;
}
- fstr_sprintf( dc_name, "\\\\%s", dc_name2 );
+ dc_name = talloc_asprintf(p->mem_ctx, "\\\\%s", dc_name2);
+ if (!dc_name) {
+ return WERR_NOMEM;
+ }
tc_status = W_ERROR_V(WERR_OK);