From f30b52490f16134b70d59a0d9e37716b62e38a73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 12 Jul 2021 08:31:18 +0200 Subject: [PATCH] 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. --- libntfs-3g/volume.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index e538fa5a..d1a5f2f0 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -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; }