btrfs-progs: safely copy path in btrfs_scan_lblkid
We should terminate the string, let's use the wrapper. Resolves-coverity-id: 1127097 Signed-off-by: David Sterba <dsterba@suse.cz>
This commit is contained in:
parent
cff33e7ebc
commit
9623d5549e
2
utils.c
2
utils.c
|
@ -2343,7 +2343,7 @@ int btrfs_scan_lblkid()
|
||||||
if (!dev)
|
if (!dev)
|
||||||
continue;
|
continue;
|
||||||
/* if we are here its definitely a btrfs disk*/
|
/* if we are here its definitely a btrfs disk*/
|
||||||
strncpy(path, blkid_dev_devname(dev), PATH_MAX);
|
strncpy_null(path, blkid_dev_devname(dev));
|
||||||
|
|
||||||
fd = open(path, O_RDONLY);
|
fd = open(path, O_RDONLY);
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
|
Loading…
Reference in New Issue