cifs: fix cifsConvertToUCS() for the mapchars case
authorJeff Layton <jlayton@redhat.com>
Tue, 17 May 2011 19:28:21 +0000 (15:28 -0400)
committerSteve Conklin <sconklin@canonical.com>
Thu, 2 Jun 2011 19:23:31 +0000 (14:23 -0500)
commit084888376b2e3da45453d1bd467fd52f2aa76ddf
treef9ccf973183a920085dea460ac4a0a2342025192
parentf4e7ab5f04d88d496c1cb131de56e54dbd8f9a9b
cifs: fix cifsConvertToUCS() for the mapchars case

BugLink: http://bugs.launchpad.net/bugs/788691

commit 11379b5e33950048ad66825da7f462b0d0da9d73 upstream.

As Metze pointed out, commit 84cdf74e broke mapchars option:

    Commit "cifs: fix unaligned accesses in cifsConvertToUCS"
    (84cdf74e8096a10dd6acbb870dd404b92f07a756) does multiple steps
    in just one commit (moving the function and changing it without
    testing).

    put_unaligned_le16(temp, &target[j]); is never called for any
    codepoint the goes via the 'default' switch statement. As a result
    we put just zero (or maybe uninitialized) bytes into the target
    buffer.

His proposed patch looks correct, but doesn't apply to the current head
of the tree. This patch should also fix it.

Reported-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Steve Conklin <sconklin@canonical.com>
fs/cifs/cifs_unicode.c