Checked name limits while looking up for an external attribute
Make sure the name of an attribute does not overflow beyond the attribute length.edge.strict_endians^2
parent
f3999a74c6
commit
4e09b252af
|
@ -2835,6 +2835,16 @@ static int ntfs_attr_find(const ATTR_TYPES type, const ntfschar *name,
|
|||
}
|
||||
} else {
|
||||
register int rc;
|
||||
|
||||
if (a->name_length
|
||||
&& ((le16_to_cpu(a->name_offset)
|
||||
+ a->name_length * sizeof(ntfschar))
|
||||
> le32_to_cpu(a->length))) {
|
||||
ntfs_log_error("Corrupt attribute name"
|
||||
" in MFT record %lld\n",
|
||||
(long long)ctx->ntfs_ino->mft_no);
|
||||
break;
|
||||
}
|
||||
if (name && ((rc = ntfs_names_full_collate(name,
|
||||
name_len, (ntfschar*)((char*)a +
|
||||
le16_to_cpu(a->name_offset)),
|
||||
|
|
Loading…
Reference in New Issue