diff --git a/convert/source-ext2.c b/convert/source-ext2.c index 5efaaa4b..becfd377 100644 --- a/convert/source-ext2.c +++ b/convert/source-ext2.c @@ -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)) {