mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-17 02:36:21 +00:00
fs/ntfs3: Improved checking of attribute's name length
Added comment, added null pointer checking. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
fc4992458e
commit
0addfb1c22
@ -137,7 +137,13 @@ next_attr:
|
|||||||
rsize = attr->non_res ? 0 : le32_to_cpu(attr->res.data_size);
|
rsize = attr->non_res ? 0 : le32_to_cpu(attr->res.data_size);
|
||||||
asize = le32_to_cpu(attr->size);
|
asize = le32_to_cpu(attr->size);
|
||||||
|
|
||||||
if (le16_to_cpu(attr->name_off) + attr->name_len > asize)
|
/*
|
||||||
|
* Really this check was done in 'ni_enum_attr_ex' -> ... 'mi_enum_attr'.
|
||||||
|
* There not critical to check this case again
|
||||||
|
*/
|
||||||
|
if (attr->name_len &&
|
||||||
|
sizeof(short) * attr->name_len + le16_to_cpu(attr->name_off) >
|
||||||
|
asize)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (attr->non_res) {
|
if (attr->non_res) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user