diff --git a/[refs] b/[refs] index 7814643a4ce4..5deacafb344c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: bd2abf177b3384375c43906be551d976e4c18166 +refs/heads/master: 8e6f195af0e1f226e9b2e0256af8df46adb9d595 diff --git a/trunk/fs/cifs/sess.c b/trunk/fs/cifs/sess.c index bbdda99dce61..758464630893 100644 --- a/trunk/fs/cifs/sess.c +++ b/trunk/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 */