Commit 652cfeb4 authored by Konstantin Komarov's avatar Konstantin Komarov

fs/ntfs3: Fixed overflow check in mi_enum_attr()

Reported-by: default avatarRobert Morris <rtm@csail.mit.edu>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 1b7dd28e
......@@ -279,7 +279,7 @@ struct ATTRIB *mi_enum_attr(struct mft_inode *mi, struct ATTRIB *attr)
if (t16 > asize)
return NULL;
if (t16 + le32_to_cpu(attr->res.data_size) > asize)
if (le32_to_cpu(attr->res.data_size) > asize - t16)
return NULL;
t32 = sizeof(short) * attr->name_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment