Add check for new attribute size being large enough

to store the attribute length in ntfs_attr_rec_resize().

(Logical change 1.561)
edge.strict_endians
cantab.net!aia21 2004-09-16 22:43:10 +00:00
parent 50e082c5e7
commit 07b1e1a361
1 changed files with 2 additions and 1 deletions

View File

@ -2258,7 +2258,8 @@ int ntfs_attr_record_resize(MFT_RECORD *m, ATTR_RECORD *a, u32 new_size)
/* Adjust @m to reflect the change in used space. */
m->bytes_in_use = cpu_to_le32(new_muse);
/* Adjust @a to reflect the new size. */
a->length = cpu_to_le32(new_size);
if (new_size >= offsetof(ATTR_REC, length) + sizeof(a->length))
a->length = cpu_to_le32(new_size);
}
return 0;
}