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:07 +0200 |
commit | c6480366e551d1dc683c2648bd897bdc7c1b90df (patch) | |
tree | f991d98516d9e3727a1020f1f025e4441567166d /source3/smbd | |
parent | a358eee2d8670d4a1675e82562fa704fa45a71e6 (diff) | |
download | samba-c6480366e551d1dc683c2648bd897bdc7c1b90df.tar.gz samba-c6480366e551d1dc683c2648bd897bdc7c1b90df.tar.bz2 samba-c6480366e551d1dc683c2648bd897bdc7c1b90df.zip |
s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_notify.c
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/smb2_notify.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source3/smbd/smb2_notify.c b/source3/smbd/smb2_notify.c index 9e377ceda4..a8b1eb433a 100644 --- a/source3/smbd/smb2_notify.c +++ b/source3/smbd/smb2_notify.c @@ -47,11 +47,9 @@ static NTSTATUS smbd_smb2_notify_recv(struct tevent_req *req, static void smbd_smb2_request_notify_done(struct tevent_req *subreq); NTSTATUS smbd_smb2_request_process_notify(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 = 0x20; - size_t body_size; uint16_t in_flags; uint32_t in_output_buffer_length; uint64_t in_file_id_persistent; @@ -59,18 +57,12 @@ NTSTATUS smbd_smb2_request_process_notify(struct smbd_smb2_request *req) uint64_t in_completion_filter; 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, 0x20); + 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_flags = SVAL(inbody, 0x02); in_output_buffer_length = IVAL(inbody, 0x04); in_file_id_persistent = BVAL(inbody, 0x08); |