[CIFS] fix unicode string alignment in SPNEGO setup
authorJeff Layton <jlayton@redhat.com>
Mon, 31 Dec 2007 04:56:21 +0000 (04:56 +0000)
committerSteve French <sfrench@us.ibm.com>
Mon, 31 Dec 2007 04:56:21 +0000 (04:56 +0000)
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>
fs/cifs/sess.c

index ce698d5f61071e1128be7f7781a872d2d3d3d1a3..d2153abcba6d7983678e8e08df39eee7bf4083a3 100644 (file)
@@ -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++;
                        }