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 <sand...@redhat.com>
---
 utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/utils.c b/utils.c
index a7441c1..c11a7c2 100644
--- a/utils.c
+++ b/utils.c
@@ -1952,7 +1952,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;
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to