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:04 +0200
commite09b3940a769806dcc17d24079375f5d53eca26a (patch)
tree7acac58f366b5675196c96549ea77c49ca1a8b7a
parent9da2f72d471460d9c953e9cee84c9cfa3611e89e (diff)
downloadsamba-e09b3940a769806dcc17d24079375f5d53eca26a.tar.gz
samba-e09b3940a769806dcc17d24079375f5d53eca26a.tar.bz2
samba-e09b3940a769806dcc17d24079375f5d53eca26a.zip
s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_close.c
metze
-rw-r--r--source3/smbd/smb2_close.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/source3/smbd/smb2_close.c b/source3/smbd/smb2_close.c
index 93ce5baf02..ffe08cc8ac 100644
--- a/source3/smbd/smb2_close.c
+++ b/source3/smbd/smb2_close.c
@@ -30,30 +30,21 @@ static NTSTATUS smbd_smb2_close(struct smbd_smb2_request *req,
NTSTATUS smbd_smb2_request_process_close(struct smbd_smb2_request *req)
{
- const uint8_t *inhdr;
const uint8_t *inbody;
int i = req->current_idx;
uint8_t *outhdr;
DATA_BLOB outbody;
- size_t expected_body_size = 0x18;
- size_t body_size;
uint16_t in_flags;
uint64_t in_file_id_persistent;
uint64_t in_file_id_volatile;
NTSTATUS status;
- 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);
- }
-
outbody = data_blob_talloc(req->out.vector, NULL, 0x3C);
if (outbody.data == NULL) {
return smbd_smb2_request_error(req, NT_STATUS_NO_MEMORY);