From bce5734a757fd59d70a52f4d4fe9abe260629b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 10 May 2022 10:40:17 +0200 Subject: [PATCH] Fixed operation on little endian data Forcing an even usa_of, in a recent security patch, must be made on cpu endian data. --- libntfs-3g/mft.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libntfs-3g/mft.c b/libntfs-3g/mft.c index 5052d1ec..aefbb5f1 100644 --- a/libntfs-3g/mft.c +++ b/libntfs-3g/mft.c @@ -1537,7 +1537,7 @@ found_free_rec: */ seq_no = m->sequence_number; if (le16_to_cpu(m->usa_ofs) <= (NTFS_BLOCK_SIZE - 2)) - usn = *(le16*)((u8*)m + le16_to_cpu(m->usa_ofs & -2)); + usn = *(le16*)((u8*)m + (le16_to_cpu(m->usa_ofs) & -2)); else usn = const_cpu_to_le16(1); if (ntfs_mft_record_layout(vol, bit, m)) {