summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2006-05-18 04:33:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:07 -0500
commit78eac3e24bcd27254aaadff498f4d177cb2c1517 (patch)
tree2d9fbe4cbc6207aff6ab9c2eec291cc9613506ba /source3/libsmb
parent13bc6d4666a60f4f6566086bc199b14470c2b1b2 (diff)
downloadsamba-78eac3e24bcd27254aaadff498f4d177cb2c1517.tar.gz
samba-78eac3e24bcd27254aaadff498f4d177cb2c1517.tar.bz2
samba-78eac3e24bcd27254aaadff498f4d177cb2c1517.zip
r15681: fix segv in 'kinit && net ads join'
(This used to be commit d77768cb237461b06119ee19f822b120623d77dd)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/cliconnect.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 3bdd78560f..2400f6ff1d 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -1493,6 +1493,7 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
{
NTSTATUS nt_status;
struct cli_state *cli = NULL;
+ int pw_len = password ? strlen(password)+1 : 0;
nt_status = cli_start_connection(&cli, my_name, dest_host,
dest_ip, port, signing_state, flags, retry);
@@ -1501,9 +1502,7 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
return nt_status;
}
- if (!cli_session_setup(cli, user, password, strlen(password)+1,
- password, strlen(password)+1,
- domain)) {
+ if (!cli_session_setup(cli, user, password, pw_len, password, pw_len, domain)) {
if ((flags & CLI_FULL_CONNECTION_ANNONYMOUS_FALLBACK)
&& cli_session_setup(cli, "", "", 0, "", 0, domain)) {
} else {
@@ -1517,8 +1516,7 @@ NTSTATUS cli_full_connection(struct cli_state **output_cli,
}
if (service) {
- if (!cli_send_tconX(cli, service, service_type,
- password, strlen(password)+1)) {
+ if (!cli_send_tconX(cli, service, service_type, password, pw_len)) {
nt_status = cli_nt_error(cli);
DEBUG(1,("failed tcon_X with %s\n", nt_errstr(nt_status)));
cli_shutdown(cli);