diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-09-06 14:01:43 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-09-07 10:38:04 +0200 |
commit | 9da2f72d471460d9c953e9cee84c9cfa3611e89e (patch) | |
tree | 28cfde44517397f98c9f1bbd79f8677c9e027afd /source3 | |
parent | 02f7c37e671c7950619c000b73c5a09ce31c68ac (diff) | |
download | samba-9da2f72d471460d9c953e9cee84c9cfa3611e89e.tar.gz samba-9da2f72d471460d9c953e9cee84c9cfa3611e89e.tar.bz2 samba-9da2f72d471460d9c953e9cee84c9cfa3611e89e.zip |
s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_break.c
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_break.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/smbd/smb2_break.c b/source3/smbd/smb2_break.c index 5d5ab4139d..ce583acca3 100644 --- a/source3/smbd/smb2_break.c +++ b/source3/smbd/smb2_break.c @@ -36,28 +36,20 @@ static NTSTATUS smbd_smb2_oplock_break_recv(struct tevent_req *req, static void smbd_smb2_request_oplock_break_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_break(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; uint8_t in_oplock_level; 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_oplock_level = CVAL(inbody, 0x02); if (in_oplock_level != SMB2_OPLOCK_LEVEL_NONE && |