diff options
-rw-r--r-- | source3/libsmb/clitrans.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c index 4bc9f4a311..329ddcaac6 100644 --- a/source3/libsmb/clitrans.c +++ b/source3/libsmb/clitrans.c @@ -209,14 +209,18 @@ static void cli_trans_format(struct cli_trans_state *state, uint8_t *pwct, switch (cmd) { case SMBtrans: - pad[0] = 0; - iov[0].iov_base = (void *)pad; - iov[0].iov_len = 1; - iov[1].iov_base = (void *)state->pipe_name_conv; - iov[1].iov_len = state->pipe_name_conv_len; + if (cli_ucs2(state->cli)) { + pad[0] = 0; + iov[0].iov_base = (void *)pad; + iov[0].iov_len = 1; + param_offset += 1; + iov += 1; + } + iov[0].iov_base = (void *)state->pipe_name_conv; + iov[0].iov_len = state->pipe_name_conv_len; wct = 14 + state->num_setup; - param_offset += iov[0].iov_len + iov[1].iov_len; - iov += 2; + param_offset += iov[0].iov_len; + iov += 1; break; case SMBtrans2: pad[0] = 0; |