mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-17 12:35:19 +00:00
Btrfs: fix off by one in null termination
A recent commit was null terminating the root listing strings one byte too short. Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
2588b4f8be
commit
134adafea2
@ -184,7 +184,7 @@ static int add_root(struct root_lookup *root_lookup,
|
||||
ri->ref_tree = ref_tree;
|
||||
strncpy(ri->name, name, name_len);
|
||||
if (name_len > 0)
|
||||
ri->name[name_len-1] = 0;
|
||||
ri->name[name_len] = 0;
|
||||
|
||||
ret = tree_insert(&root_lookup->root, root_id, ref_tree, &ri->rb_node);
|
||||
if (ret) {
|
||||
|
Loading…
Reference in New Issue
Block a user