From 224c2fcda2a39fb15ff6fcb59934c59fea0a3d30 Mon Sep 17 00:00:00 2001 From: jpandre Date: Mon, 2 Mar 2009 20:24:16 +0000 Subject: [PATCH] Changed attribute name offset when there is no name (Faisal Puthuparackat) --- libntfs-3g/attrib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libntfs-3g/attrib.c b/libntfs-3g/attrib.c index 9f27dfdb..b8b464bb 100644 --- a/libntfs-3g/attrib.c +++ b/libntfs-3g/attrib.c @@ -2761,7 +2761,8 @@ int ntfs_resident_attr_record_add(ntfs_inode *ni, ATTR_TYPES type, a->length = cpu_to_le32(length); a->non_resident = 0; a->name_length = name_len; - a->name_offset = cpu_to_le16(offsetof(ATTR_RECORD, resident_end)); + a->name_offset = (name_len + ? cpu_to_le16(offsetof(ATTR_RECORD, resident_end)) : 0); a->flags = flags; a->instance = m->next_attr_instance; a->value_length = cpu_to_le32(size);