Fix truncation of resident attributes (new attribute length calculation

was incorrect).

(Logical change 1.68)
edge.strict_endians
cantab.net!aia21 2002-12-28 19:19:05 +00:00
parent ab04f3489a
commit 65f89be321
1 changed files with 1 additions and 2 deletions

View File

@ -1932,8 +1932,7 @@ int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a,
// name, too. (AIA)
/* Calculate the new attribute length and mft record bytes used. */
new_alen = (le32_to_cpu(a->length) - le32_to_cpu(a->value_length) +
newsize + 7) & ~7;
new_alen = (le16_to_cpu(a->value_offset) + newsize + 7) & ~7;
/* If the actual attribute length has changed, move tihings around. */
if (new_alen != le32_to_cpu(a->length)) {
new_muse = le32_to_cpu(m->bytes_in_use) -