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:
David Sterba 2015-01-03 03:24:10 +01:00
parent cff33e7ebc
commit 9623d5549e
1 changed files with 1 additions and 1 deletions

View File

@ -2343,7 +2343,7 @@ int btrfs_scan_lblkid()
if (!dev)
continue;
/* 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);
if (fd < 0) {