From 38206f16bd9008dc9bc6e180686fa1eac954f8b4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 13 Sep 2011 17:05:51 +0200 Subject: s3:libsmb: make sure cli->max_mux is valid in the return of the server metze --- source3/libsmb/cliconnect.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/libsmb') diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 09cca7f018..66c1937504 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -2731,6 +2731,7 @@ static void cli_negprot_done(struct tevent_req *subreq) cli->sec_mode = 0; cli->serverzone = get_time_zone(time(NULL)); cli->max_xmit = 1024; + cli->max_mux = 1; } if (cli->max_xmit < 1024) { @@ -2738,6 +2739,11 @@ static void cli_negprot_done(struct tevent_req *subreq) return; } + if (cli->max_mux < 1) { + tevent_req_nterror(req, NT_STATUS_INVALID_NETWORK_RESPONSE); + return; + } + cli->max_xmit = MIN(cli->max_xmit, CLI_BUFFER_SIZE); /* a way to force ascii SMB */ -- cgit