From 01161bc99be149502163328fa1796864c9bb343b Mon Sep 17 00:00:00 2001 From: "(none)!yura" <(none)!yura> Date: Wed, 13 Oct 2004 12:01:03 +0000 Subject: [PATCH] add check that $ATTRIBUTE_LIST should be <= 0x40000 to ntfs_attr_size_bounds_check (Logical change 1.611) --- libntfs/attrib.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libntfs/attrib.c b/libntfs/attrib.c index bddd5dbd..3b5dc560 100644 --- a/libntfs/attrib.c +++ b/libntfs/attrib.c @@ -2156,6 +2156,16 @@ int ntfs_attr_size_bounds_check(const ntfs_volume *vol, const ATTR_TYPES type, errno = EINVAL; return -1; } + + /* + * $ATTRIBUTE_LIST should be not greater than 0x40000, but this is not + * listed in the AttrDef. + */ + if (type == AT_ATTRIBUTE_LIST && size > 0x40000) { + errno = ERANGE; + return -1; + } + ad = ntfs_attr_find_in_attrdef(vol, type); if (!ad) return -1;