Restricted the attribute definition table size to 24 bits

The standard size is 2560 bytes. It can be extended for specific purposes,
but its former limit to 32 bits was unreasonable. Anyway ntfs-3g is
not committed to support non-standard situations.
edge.strict_endians^2
Jean-Pierre André 2021-07-12 08:31:18 +02:00
parent af1bc0f5ec
commit f30b52490f
1 changed files with 3 additions and 3 deletions

View File

@ -1248,10 +1248,10 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, ntfs_mount_flags flags)
ntfs_log_perror("Failed to open ntfs attribute");
goto error_exit;
}
/* Check we don't overflow 32-bits. */
if (na->data_size > 0xffffffffLL) {
/* Check we don't overflow 24-bits. */
if ((u64)na->data_size > 0xffffffLL) {
ntfs_log_error("Attribute definition table is too big (max "
"32-bit allowed).\n");
"24-bit allowed).\n");
errno = EINVAL;
goto error_exit;
}