summaryrefslogtreecommitdiff
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-24 20:46:54 +0300
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-24 20:46:54 +0300
commit5394cd218735bf462e72bb827fbb7e47fc15f2f0 (patch)
treebdbc64d378a015fd921d2adc1cac49752f3121f1 /fs/cifs/sess.c
parent6f3776c9cd03998f0e6d11774a03aa1788b4e463 (diff)
parent8e6f195af0e1f226e9b2e0256af8df46adb9d595 (diff)
downloadlinux-5394cd218735bf462e72bb827fbb7e47fc15f2f0.tar.xz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6: [CIFS] Fix oops when Windows server sent bad domain name null terminator [CIFS] cifs sprintf fix [CIFS] Remove 2 unneeded kzalloc casts [CIFS] Update CIFS version number
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index bbdda99dce61..758464630893 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -182,11 +182,14 @@ static int decode_unicode_ssetup(char ** pbcc_area, int bleft, struct cifsSesInf
cFYI(1,("bleft %d",bleft));
- /* word align, if bytes remaining is not even */
- if(bleft % 2) {
- bleft--;
- data++;
- }
+ /* SMB header is unaligned, so cifs servers word align start of
+ Unicode strings */
+ data++;
+ bleft--; /* Windows servers do not always double null terminate
+ their final Unicode string - in which case we
+ now will not attempt to decode the byte of junk
+ which follows it */
+
words_left = bleft / 2;
/* save off server operating system */