From: Jeff Layton Date: Mon, 31 Dec 2007 04:56:21 +0000 (+0000) Subject: [CIFS] fix unicode string alignment in SPNEGO setup X-Git-Tag: v2.6.25-rc1~1226^2~9 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=28c5a02a11f70bb1fd8dd3b633206e2db3220308;p=cascardo%2Flinux.git [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 Signed-off-by: Steve French --- diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index ce698d5f6107..d2153abcba6d 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -542,7 +542,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, if (ses->capabilities & CAP_UNICODE) { /* 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++; }