diff options
author | Eric Sandeen <sandeen@redhat.com> | 2013-11-06 17:15:42 -0600 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-07 16:10:41 -0500 |
commit | 6e6e886809ed5e86979ebeca9cbcc550c49a69c8 (patch) | |
tree | 3bf2009a42c04dfbe9390849d1089ce938326df1 /utils.c | |
parent | 667c121184f374bfd8d18275f6cd53472f991677 (diff) |
btrfs-progs: use strncpy in btrfs_scan_lblkid()
Use strncpy(... ,PATH_MAX) to be sure we don't overflow
the path[PATH_MAX] array.
Resolves-Coverity-CID: 1125941
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1975,7 +1975,7 @@ int btrfs_scan_lblkid(int update_kernel) if (!dev) continue; /* if we are here its definitly a btrfs disk*/ - strcpy(path, blkid_dev_devname(dev)); + strncpy(path, blkid_dev_devname(dev), PATH_MAX); if (test_skip_this_disk(path)) continue; |