From 0911ef206dc8fea68e18282a1ee5f4489cf0ca1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 19 Jul 2021 09:23:23 +0200 Subject: [PATCH] Rejected negative data length in an attribute list The negative data length of an attribute list is an indication of a probable corruption and must be rejected. --- libntfs-3g/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libntfs-3g/inode.c b/libntfs-3g/inode.c index fe57efaa..8819ff1d 100644 --- a/libntfs-3g/inode.c +++ b/libntfs-3g/inode.c @@ -231,9 +231,9 @@ static ntfs_inode *ntfs_inode_real_open(ntfs_volume *vol, const MFT_REF mref) l = ntfs_get_attribute_value_length(ctx->attr); if (!l) goto put_err_out; - if (l > 0x40000) { + if ((u64)l > 0x40000) { errno = EIO; - ntfs_log_perror("Too large attrlist attribute (%lld), inode " + ntfs_log_perror("Too large attrlist attribute (%llu), inode " "%lld", (long long)l, (long long)MREF(mref)); goto put_err_out; }