]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:libsmb: only align unicode pipe_name (bug #8586)
authorStefan Metzmacher <metze@samba.org>
Fri, 18 Nov 2011 07:40:18 +0000 (08:40 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 18 Nov 2011 12:30:48 +0000 (13:30 +0100)
metze

source3/libsmb/clitrans.c

index 4bc9f4a31158928c96d46d77716470b621c8a637..329ddcaac6334624d9017a40b72bc224e24d19a8 100644 (file)
@@ -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;