X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fcifs%2Fsess.c;h=758464630893e8082339f6018ce16cf74028e9e5;hb=28f95cbc3ec01f2c7d248e1a4a384f37e9c2ab16;hp=bbdda99dce610364b71b5218cb061b3dfc577cd9;hpb=239fd45938f9ddf64f120e0260c7b76eb73bd5a7;p=mv-sheeva.git diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index bbdda99dce6..75846463089 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 */