diff options
Diffstat (limited to 'fs/cifs/sess.c')
| -rw-r--r-- | fs/cifs/sess.c | 13 |
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 | |||
| 182 | cFYI(1,("bleft %d",bleft)); | 182 | cFYI(1,("bleft %d",bleft)); |
| 183 | 183 | ||
| 184 | 184 | ||
| 185 | /* word align, if bytes remaining is not even */ | 185 | /* SMB header is unaligned, so cifs servers word align start of |
| 186 | if(bleft % 2) { | 186 | Unicode strings */ |
| 187 | bleft--; | 187 | data++; |
| 188 | data++; | 188 | bleft--; /* Windows servers do not always double null terminate |
| 189 | } | 189 | their final Unicode string - in which case we |
| 190 | now will not attempt to decode the byte of junk | ||
| 191 | which follows it */ | ||
| 192 | |||
| 190 | words_left = bleft / 2; | 193 | words_left = bleft / 2; |
| 191 | 194 | ||
| 192 | /* save off server operating system */ | 195 | /* save off server operating system */ |
