btrfs-progs: subvol list: fix accidental trimming of subvolume name
Commit 4db925911c
("btrfs-progs: use strncpy_null everywhere") did
not properly convert the subvolume name copying to strncpy_null() and
trimmed the last character.
Issue: #829
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
712f009f6f
commit
ab2260355a
|
@ -547,7 +547,7 @@ static int update_root(struct rb_root *root_lookup,
|
||||||
error_msg(ERROR_MSG_MEMORY, NULL);
|
error_msg(ERROR_MSG_MEMORY, NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
strncpy_null(ri->name, name, name_len);
|
strncpy_null(ri->name, name, name_len + 1);
|
||||||
}
|
}
|
||||||
if (ref_tree)
|
if (ref_tree)
|
||||||
ri->ref_tree = ref_tree;
|
ri->ref_tree = ref_tree;
|
||||||
|
@ -618,7 +618,7 @@ static int add_root(struct rb_root *root_lookup,
|
||||||
error_msg(ERROR_MSG_MEMORY, NULL);
|
error_msg(ERROR_MSG_MEMORY, NULL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
strncpy_null(ri->name, name, name_len);
|
strncpy_null(ri->name, name, name_len + 1);
|
||||||
}
|
}
|
||||||
if (ref_tree)
|
if (ref_tree)
|
||||||
ri->ref_tree = ref_tree;
|
ri->ref_tree = ref_tree;
|
||||||
|
|
Loading…
Reference in New Issue