Fixed operation on little endian data

Forcing an even usa_of, in a recent security patch, must be made on cpu
endian data.
pull/40/head
Jean-Pierre André 2022-05-10 10:40:17 +02:00
parent 96412e28e5
commit bce5734a75
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {