From 84f042e73962e5e0a7162051d5f1814e41ef396e Mon Sep 17 00:00:00 2001 From: Erik Larsson Date: Mon, 4 Jan 2016 10:19:05 +0100 Subject: [PATCH] reparse.c: Fix big-endian bug when converting file name to lowercase. When looking up the lowercase equivalent of a Unicode character in ntfs_fix_file_name, no byte swapping was performed on the ntfschar used as index into the 'locase' array. This would lead to very strange results on big-endian systems. --- libntfs-3g/reparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libntfs-3g/reparse.c b/libntfs-3g/reparse.c index 7b96902c..ee14efbe 100644 --- a/libntfs-3g/reparse.c +++ b/libntfs-3g/reparse.c @@ -195,7 +195,7 @@ static u64 ntfs_fix_file_name(ntfs_inode *dir_ni, ntfschar *uname, uname[i] = found->file_name[i]; } else { for (i=0; ifile_name_length; i++) - uname[i] = vol->locase[found->file_name[i]]; + uname[i] = vol->locase[le16_to_cpu(found->file_name[i])]; } } } -- 2.11.0