]> git.hungrycats.org Git - linux/commitdiff
cifs: fix return value in cifsConvertToUTF16
authorJeff Layton <jlayton@redhat.com>
Tue, 18 Sep 2012 18:21:01 +0000 (14:21 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 10 Oct 2012 02:30:58 +0000 (03:30 +0100)
commit c73f693989d7a7d99ec66a7065295a0c93d0b127 upstream.

This function returns the wrong value, which causes the callers to get
the length of the resulting pathname wrong when it contains non-ASCII
characters.

This seems to fix https://bugzilla.samba.org/show_bug.cgi?id=6767

Reported-by: Baldvin Kovacs <baldvin.kovacs@gmail.com>
Reported-and-Tested-by: Nicolas Lefebvre <nico.lefebvre@gmail.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/cifs/cifs_unicode.c

index 1b2e180b018dd01e9d65041c6eb8cc288974b2c3..667776ed89674577a8fe9702d7959759949ba780 100644 (file)
@@ -327,6 +327,6 @@ cifsConvertToUCS(__le16 *target, const char *source, int srclen,
        }
 
 ctoUCS_out:
-       return i;
+       return j;
 }