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:06 +0200 |
commit | 22d479f75794b7c5fcac2fd47fbfd767700507d6 (patch) | |
tree | bc175c6209ae9a0d702daa8037e16a4ce6f20ccb /source3 | |
parent | 29b3601c028b8861102b1d988285c78fc17f3b8e (diff) | |
download | samba-22d479f75794b7c5fcac2fd47fbfd767700507d6.tar.gz samba-22d479f75794b7c5fcac2fd47fbfd767700507d6.tar.bz2 samba-22d479f75794b7c5fcac2fd47fbfd767700507d6.zip |
s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_keepalive.c
metze
Diffstat (limited to 'source3')
-rw-r--r-- | source3/smbd/smb2_keepalive.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source3/smbd/smb2_keepalive.c b/source3/smbd/smb2_keepalive.c index a830260b24..24a4f8eade 100644 --- a/source3/smbd/smb2_keepalive.c +++ b/source3/smbd/smb2_keepalive.c @@ -25,21 +25,12 @@ NTSTATUS smbd_smb2_request_process_keepalive(struct smbd_smb2_request *req) { - const uint8_t *inbody; - int i = req->current_idx; DATA_BLOB outbody; - size_t expected_body_size = 0x04; - size_t body_size; + NTSTATUS status; - if (req->in.vector[i+1].iov_len != (expected_body_size & 0xFFFFFFFE)) { - return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); - } - - 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); + status = smbd_smb2_request_verify_sizes(req, 0x04); + if (!NT_STATUS_IS_OK(status)) { + return smbd_smb2_request_error(req, status); } /* TODO: update some time stamps */ |