summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-18 08:40:18 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-18 13:30:48 +0100
commit48bcb8c846532ccd5489ef705182fb81c5278b04 (patch)
tree9d2e4de9806a8ba8aa1a9370e070959fd49da8f1 /source3
parent2642f385887fbd3aecd4286a4d6223a21d981714 (diff)
downloadsamba-48bcb8c846532ccd5489ef705182fb81c5278b04.tar.gz
samba-48bcb8c846532ccd5489ef705182fb81c5278b04.tar.bz2
samba-48bcb8c846532ccd5489ef705182fb81c5278b04.zip
s3:libsmb: only align unicode pipe_name (bug #8586)
metze
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/clitrans.c18
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;