s3: Fix bug 7635
authorVolker Lendecke <vl@samba.org>
Sat, 21 Aug 2010 09:32:58 +0000 (11:32 +0200)
committerKarolin Seeger <kseeger@samba.org>
Mon, 27 Sep 2010 19:29:00 +0000 (21:29 +0200)
smbclient -M not sending due to NT_STATUS_PIPE_BROKEN
(cherry picked from commit fe4dcd44ec581afb631125b1d0bade055ca97e30)

source3/libsmb/climessage.c

index 2c8ef58b512e82f65b24433d83ea2aff948c7fda..0993037a48e6a9bd09f0291fe679cef63130a532 100644 (file)
@@ -63,8 +63,10 @@ static struct tevent_req *cli_message_start_send(TALLOC_CTX *mem_ctx,
 
        *p++ = 4;
        memcpy(p, utmp, ulen);
+       p += ulen;
        *p++ = 4;
        memcpy(p, htmp, hlen);
+       p += hlen;
        TALLOC_FREE(htmp);
        TALLOC_FREE(utmp);
 
@@ -163,8 +165,8 @@ static struct tevent_req *cli_message_text_send(TALLOC_CTX *mem_ctx,
                TALLOC_FREE(tmp);
                return tevent_req_post(req, ev);
        }
-       SCVAL(bytes, 0, 0);     /* pad */
-       SSVAL(bytes, 1, msglen);
+       SCVAL(bytes, 0, 1);     /* pad */
+       SSVAL(bytes+1, 0, msglen);
        memcpy(bytes+3, msg, msglen);
        TALLOC_FREE(tmp);