From: Ralph Wuerthner Date: Wed, 10 Jul 2013 06:59:58 +0000 (+0200) Subject: s3:smbd: return NT_STATUS_INFO_LENGTH_MISMATCH for GetInfo in case output_buffer_leng... X-Git-Tag: talloc-2.1.0~315 X-Git-Url: http://git.samba.org/?p=samba.git;a=commitdiff_plain;h=a93f9c3d33e442c84d0c9da7eb5d25ca4b54fc33 s3:smbd: return NT_STATUS_INFO_LENGTH_MISMATCH for GetInfo in case output_buffer_length is too small Reviewed-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/smb2_getinfo.c b/source3/smbd/smb2_getinfo.c index 5616c849ade..ec0bad02206 100644 --- a/source3/smbd/smb2_getinfo.c +++ b/source3/smbd/smb2_getinfo.c @@ -498,6 +498,11 @@ static struct tevent_req *smbd_smb2_getinfo_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, ev); } + if (state->out_output_buffer.length > in_output_buffer_length) { + tevent_req_nterror(req, NT_STATUS_INFO_LENGTH_MISMATCH); + return tevent_req_post(req, ev); + } + tevent_req_done(req); return tevent_req_post(req, ev); }