Use a preallocated buffer for the first response in the compound chain.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
int vector_count;
#define OUTVEC_ALLOC_SIZE (SMB2_HDR_BODY + 9)
uint8_t _hdr[OUTVEC_ALLOC_SIZE];
+ uint8_t _body[0x58];
} out;
};
DATA_BLOB smbd_smb2_generate_outbody(struct smbd_smb2_request *req, size_t size)
{
+ if (req->current_idx <= 1) {
+ if (size <= sizeof(req->out._body)) {
+ return data_blob_const(req->out._body, size);
+ }
+ }
+
return data_blob_talloc(req->out.vector, NULL, size);
}