summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libsmb/smb2cli_tcon.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/libsmb/smb2cli_tcon.c b/source3/libsmb/smb2cli_tcon.c
index c51418227d..8c2c802bdd 100644
--- a/source3/libsmb/smb2cli_tcon.c
+++ b/source3/libsmb/smb2cli_tcon.c
@@ -60,12 +60,17 @@ struct tevent_req *smb2cli_tcon_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
if (!convert_string_talloc(state, CH_UNIX, CH_UTF16,
- tcon_share, talloc_get_size(tcon_share),
+ tcon_share, strlen(tcon_share),
&dyn, &dyn_len)) {
tevent_req_oom(req);
return tevent_req_post(req, ev);
}
+ if (strlen(tcon_share) == 0) {
+ TALLOC_FREE(dyn);
+ dyn_len = 0;
+ }
+
fixed = state->fixed;
SSVAL(fixed, 0, 9);
SSVAL(fixed, 4, SMB2_HDR_BODY + 8);