From 5df39c1e43e8d903ef4317e505cf85e64ef7e172 Mon Sep 17 00:00:00 2001 From: luozhengzheng Date: Fri, 23 Sep 2016 06:55:41 +0800 Subject: Fix coverity defects 1.coverity scan CID:147445 function zfs_do_send in zfs_main.c Buffer not null terminated (BUFFER_SIZE_WARNING) 2.coverity scan CID:147443 function zfs_do_bookmark in zfs_main.c Buffer not null terminated (BUFFER_SIZE_WARNING) 3.coverity scan CID:147660 function main in zinject.c Passing string argv[0] of unknown size to strcpy By the way, the leak of g_zfs is fixed. 4.coverity scan CID: 147442 function make_disks in zpool_vdev.c Buffer not null terminated (BUFFER_SIZE_WARNING) 5.coverity scan CID: 147661 function main in dir_rd_update.c passing string cp1 of unknown size to strcpy Reviewed-by: Brian Behlendorf Signed-off-by: luozhengzheng Closes #5130 --- cmd/zpool/zpool_vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmd/zpool') diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index 7d114889f..0614caf6b 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -1199,7 +1199,7 @@ make_disks(zpool_handle_t *zhp, nvlist_t *nv) * window between when udev deletes and recreates the link * during which access attempts will fail with ENOENT. */ - strncpy(udevpath, path, MAXPATHLEN); + strlcpy(udevpath, path, MAXPATHLEN); (void) zfs_append_partition(udevpath, MAXPATHLEN); fd = open(devpath, O_RDWR|O_EXCL); -- cgit v1.2.3