[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-cifs-client
Subject:    [linux-cifs-client] [PATCH] [CIFS] fix unicode string alignment in
From:       Jeff Layton <jlayton () redhat ! com>
Date:       2007-12-17 19:17:06
Message-ID: 1197919026-6858-1-git-send-email-jlayton () redhat ! com
[Download RAW message or body]

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@redhat.com>
---
 fs/cifs/sess.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index d0cb469..74ecbc1 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -540,7 +540,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++;
 			}
-- 
1.5.3.6

_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@lists.samba.org
https://lists.samba.org/mailman/listinfo/linux-cifs-client
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic