mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-23 12:14:24 +08:00
btrfs-progs: convert: copy whole xattr name buffer
Commit 4db925911c
("btrfs-progs: use strncpy_null everywhere")
replaced strncpy with strncpy_null, the maximum xattr name length is 255
(current limit), the target buffer is large enough for the whole size so
make sure the last character is also copied.
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ab2260355a
commit
ed1c6b8c00
@ -639,7 +639,7 @@ static int ext2_copy_single_xattr(struct btrfs_trans_handle *trans,
|
||||
data = databuf;
|
||||
datalen = bufsize;
|
||||
}
|
||||
strncpy_null(namebuf, xattr_prefix_table[name_index], XATTR_NAME_MAX);
|
||||
strncpy_null(namebuf, xattr_prefix_table[name_index], XATTR_NAME_MAX + 1);
|
||||
strncat(namebuf, EXT2_EXT_ATTR_NAME(entry), entry->e_name_len);
|
||||
if (name_len + datalen > BTRFS_LEAF_DATA_SIZE(root->fs_info) -
|
||||
sizeof(struct btrfs_item) - sizeof(struct btrfs_dir_item)) {
|
||||
|
Loading…
Reference in New Issue
Block a user