Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd5707e1 authored by Jeff Layton's avatar Jeff Layton Committed by Steve French
Browse files

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: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJeff Layton <jlayton@redhat.com>
Signed-off-by: default avatarSteve French <sfrench@us.ibm.com>
parent 4358b567
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -339,12 +339,13 @@ static int validate_t2(struct smb_t2_rsp *pSMB)
	    get_unaligned_le16(&pSMB->t2_rsp.DataOffset) > 1024)
		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);
	if (total_size >= 512)
		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);
	if (total_size > get_bcc(&pSMB->hdr) ||
	    total_size >= CIFSMaxBufSize + MAX_CIFS_HDR_SIZE)