提交 fd5707e1 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: fix comment in validate_t2

The comment about checking the bcc is in the wrong place. Also make it
match kernel coding style.
Reported-and-acked-by: NDavid Howells <dhowells@redhat.com>
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 4358b567
...@@ -339,12 +339,13 @@ static int validate_t2(struct smb_t2_rsp *pSMB) ...@@ -339,12 +339,13 @@ static int validate_t2(struct smb_t2_rsp *pSMB)
get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024) get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024)
goto vt2_err; goto vt2_err;
/* check that bcc is at least as big as parms + data */
/* check that bcc is less than negotiated smb buffer */
total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount); total_size = get_unaligned_le16(&pSMB->t2_rsp.ParameterCount);
if (total_size >= 512) if (total_size >= 512)
goto vt2_err; goto vt2_err;
/* check that bcc is at least as big as parms + data, and that it is
* less than negotiated smb buffer
*/
total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount); total_size += get_unaligned_le16(&pSMB->t2_rsp.DataCount);
if (total_size > get_bcc(&pSMB->hdr) || if (total_size > get_bcc(&pSMB->hdr) ||
total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE) total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册