summaryrefslogtreecommitdiff
path: root/source3/libsmb/smb2cli_create.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-07 08:15:00 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 10:21:55 +0200
commit674f9cc1d9f45a955802571936ff275e0444b2ea (patch)
tree2b72046b183735933bf6bf43b15c46d80012cbb6 /source3/libsmb/smb2cli_create.c
parent013d2abc75b7d17e8ea22ae1d90c0308f3332ad0 (diff)
downloadsamba-674f9cc1d9f45a955802571936ff275e0444b2ea.tar.gz
samba-674f9cc1d9f45a955802571936ff275e0444b2ea.tar.bz2
samba-674f9cc1d9f45a955802571936ff275e0444b2ea.zip
s3:smb2cli: fix marshalling of smb2_create_blobs in smb2cli_create()
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Sep 7 10:21:55 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/libsmb/smb2cli_create.c')
-rw-r--r--source3/libsmb/smb2cli_create.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/libsmb/smb2cli_create.c b/source3/libsmb/smb2cli_create.c
index 68bb98180e..2145ce25f6 100644
--- a/source3/libsmb/smb2cli_create.c
+++ b/source3/libsmb/smb2cli_create.c
@@ -114,8 +114,10 @@ struct tevent_req *smb2cli_create_send(
blobs_offset = name_utf16_len;
blobs_offset = ((blobs_offset + 3) & ~3);
- SIVAL(fixed, 48, blobs_offset + SMB2_HDR_BODY + 56);
- SIVAL(fixed, 52, blob.length);
+ if (blob.length > 0) {
+ SIVAL(fixed, 48, blobs_offset + SMB2_HDR_BODY + 56);
+ SIVAL(fixed, 52, blob.length);
+ }
dyn_len = MAX(1, blobs_offset + blob.length);
dyn = talloc_zero_array(state, uint8_t, dyn_len);
@@ -129,7 +131,7 @@ struct tevent_req *smb2cli_create_send(
}
if (blob.data != NULL) {
- memcpy(dyn + blobs_offset - (SMB2_HDR_BODY + 56),
+ memcpy(dyn + blobs_offset,
blob.data, blob.length);
data_blob_free(&blob);
}