Skip to content

Commit 90c1cd5

Browse files
Thomas Kühnelaalexandrovich
authored andcommitted
fs/ntfs3: Fix endian conversion in ni_fname_name
ni_fname_name called ntfs_cmp_names_cpu which assumes that the first string is in CPU byte order and the second one in little endian. In this case both strings are little endian so ntfs_cmp_names is the correct function to call. Signed-off-by: Thomas Kühnel <[email protected]> Reviewed-by: Nicolas Schier <[email protected]> Signed-off-by: Konstantin Komarov <[email protected]>
1 parent ecfbd57 commit 90c1cd5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ntfs3/frecord.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1645,6 +1645,7 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
16451645
{
16461646
struct ATTRIB *attr = NULL;
16471647
struct ATTR_FILE_NAME *fname;
1648+
struct le_str *fns;
16481649

16491650
if (le)
16501651
*le = NULL;
@@ -1668,7 +1669,8 @@ struct ATTR_FILE_NAME *ni_fname_name(struct ntfs_inode *ni,
16681669
if (uni->len != fname->name_len)
16691670
goto next;
16701671

1671-
if (ntfs_cmp_names_cpu(uni, (struct le_str *)&fname->name_len, NULL,
1672+
fns = (struct le_str *)&fname->name_len;
1673+
if (ntfs_cmp_names(uni->name, uni->len, fns->name, fns->len, NULL,
16721674
false))
16731675
goto next;
16741676

0 commit comments

Comments
 (0)