From e657cc470a2f43588675e1053596efe4ee1800dd Mon Sep 17 00:00:00 2001 From: Steve French Date: Mon, 22 Jan 2007 01:19:30 +0000 Subject: [PATCH] --- yaml --- r: 45799 b: refs/heads/master c: 8e6f195af0e1f226e9b2e0256af8df46adb9d595 h: refs/heads/master i: 45797: f28af37459b6ea1bb64f595c4e8931d22d877487 45795: 613a09a6f7890805030ca874f9b5e05a8413895d 45791: 57ef23c642878302b7507701d3bfad016e4d4e7d v: v3 --- [refs] | 2 +- trunk/fs/cifs/sess.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) 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 */