summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-09-06 14:01:43 +0200
committerStefan Metzmacher <metze@samba.org>2011-09-07 10:38:05 +0200
commit440f702aa9a020f8cfe13037b7af1ba0dadf86f2 (patch)
treecdd49fd9e4daa83ff2d74285dbfd78df2b74b4da
parentbc95ab99dc84fa6d567a7d4e803552363bbc07a9 (diff)
downloadsamba-440f702aa9a020f8cfe13037b7af1ba0dadf86f2.tar.gz
samba-440f702aa9a020f8cfe13037b7af1ba0dadf86f2.tar.bz2
samba-440f702aa9a020f8cfe13037b7af1ba0dadf86f2.zip
s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_flush.c
metze
-rw-r--r--source3/smbd/smb2_flush.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/smbd/smb2_flush.c b/source3/smbd/smb2_flush.c
index c3f5a30129..9b00eb2878 100644
--- a/source3/smbd/smb2_flush.c
+++ b/source3/smbd/smb2_flush.c
@@ -33,27 +33,19 @@ static NTSTATUS smbd_smb2_flush_recv(struct tevent_req *req);
static void smbd_smb2_request_flush_done(struct tevent_req *subreq);
NTSTATUS smbd_smb2_request_process_flush(struct smbd_smb2_request *req)
{
- const uint8_t *inhdr;
+ NTSTATUS status;
const uint8_t *inbody;
int i = req->current_idx;
- size_t expected_body_size = 0x18;
- size_t body_size;
uint64_t in_file_id_persistent;
uint64_t in_file_id_volatile;
struct tevent_req *subreq;
- inhdr = (const uint8_t *)req->in.vector[i+0].iov_base;
- if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) {
- return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
+ status = smbd_smb2_request_verify_sizes(req, 0x18);
+ if (!NT_STATUS_IS_OK(status)) {
+ return smbd_smb2_request_error(req, status);
}
-
inbody = (const uint8_t *)req->in.vector[i+1].iov_base;
- body_size = SVAL(inbody, 0x00);
- if (body_size != expected_body_size) {
- return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
- }
-
in_file_id_persistent = BVAL(inbody, 0x08);
in_file_id_volatile = BVAL(inbody, 0x10);