s3:smb2cli: SMB2_CREATE needs one dyn byte to that the structure size check works.
authorStefan Metzmacher <metze@samba.org>
Mon, 5 Sep 2011 16:22:57 +0000 (18:22 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 7 Sep 2011 06:32:08 +0000 (08:32 +0200)
Windows generates NT_STATUS_INVALID_PARAMETER otherwise.

metze

source3/libsmb/smb2cli_create.c

index ecb220d4ac328c2d3322c729aa7dcb9ddd0ac816..50c9816ded404cacec94fee86565cdce52d939d5 100644 (file)
@@ -112,7 +112,7 @@ struct tevent_req *smb2cli_create_send(
        SIVAL(fixed, 48, blobs_offset + SMB2_HDR_BODY + 56);
        SIVAL(fixed, 52, blob.length);
 
-       dyn_len = blobs_offset + blob.length;
+       dyn_len = MAX(1, blobs_offset + blob.length);
        dyn = talloc_zero_array(state, uint8_t, dyn_len);
        if (tevent_req_nomem(dyn, req)) {
                return tevent_req_post(req, ev);