浏览代码

[CIFS] fix unicode string alignment in SPNEGO setup

Unicode strings need to be word aligned, but the code that handles that
is currently not taking the length of the SPNEGO blob into account. Fix
it to do so.

Signed-off-by: Jeff Layton <jlayton@tupile.poochiereds.net>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Jeff Layton 17 年之前
父节点
当前提交
28c5a02a11
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      fs/cifs/sess.c

+ 1 - 1
fs/cifs/sess.c

@@ -542,7 +542,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
 
 
 		if (ses->capabilities & CAP_UNICODE) {
 		if (ses->capabilities & CAP_UNICODE) {
 			/* unicode strings must be word aligned */
 			/* unicode strings must be word aligned */
-			if (iov[0].iov_len % 2) {
+			if ((iov[0].iov_len + iov[1].iov_len) % 2) {
 				*bcc_ptr = 0;
 				*bcc_ptr = 0;
 				bcc_ptr++;
 				bcc_ptr++;
 			}
 			}