cifs: use CIFS_MAX_DOMAINNAME_LEN when converting the domain name
authorJerome Marchand <jmarchan@redhat.com>
Thu, 26 May 2016 09:52:24 +0000 (11:52 +0200)
committerSteve French <smfrench@gmail.com>
Fri, 24 Jun 2016 04:44:56 +0000 (23:44 -0500)
Currently in build_ntlmssp_auth_blob(), when converting the domain
name to UTF16, CIFS_MAX_USERNAME_LEN limit is used. It should be
CIFS_MAX_DOMAINNAME_LEN. This patch fixes this.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/sess.c

index af0ec2d5ad0e9da25af4ec8528266451a42cc8b5..c3d086e2bd569bcdfbd565b68d5759a2817772e9 100644 (file)
@@ -430,7 +430,7 @@ int build_ntlmssp_auth_blob(unsigned char *pbuffer,
        } else {
                int len;
                len = cifs_strtoUTF16((__le16 *)tmp, ses->domainName,
-                                     CIFS_MAX_USERNAME_LEN, nls_cp);
+                                     CIFS_MAX_DOMAINNAME_LEN, nls_cp);
                len *= 2; /* unicode is 2 bytes each */
                sec_blob->DomainName.BufferOffset = cpu_to_le32(tmp - pbuffer);
                sec_blob->DomainName.Length = cpu_to_le16(len);