Skip to content

Commit 652cfeb

Browse files
fs/ntfs3: Fixed overflow check in mi_enum_attr()
Reported-by: Robert Morris <rtm@csail.mit.edu> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 1b7dd28 commit 652cfeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ntfs3/record.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
279279
if (t16 > asize)
280280
return NULL;
281281

282-
if (t16 + le32_to_cpu(attr->res.data_size) > asize)
282+
if (le32_to_cpu(attr->res.data_size) > asize - t16)
283283
return NULL;
284284

285285
t32 = sizeof(short) * attr->name_len;

0 commit comments

Comments
 (0)