diff options
author | cao <[email protected]> | 2016-09-30 03:06:14 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-09-29 12:06:14 -0700 |
commit | c9d61adbf8f422fe8d3bda45d9de9e82c757d0b0 (patch) | |
tree | d1c9b4684e6a08bc61927d635975e0d78daa771f /module/zfs/dsl_dataset.c | |
parent | 12fa7f3436fbd89f4d6b00c2c076405e7a21d62f (diff) |
Fix coverity defects: 147658, 147652, 147651
coverity scan CID:147658, Type:copy into fixed size buffer.
coverity scan CID:147652, Type:copy into fixed size buffer.
coverity scan CID:147651, Type:copy into fixed size buffer.
Reviewed-by: Richard Laager <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: cao.xuewen <[email protected]>
Closes #5160
Diffstat (limited to 'module/zfs/dsl_dataset.c')
-rw-r--r-- | module/zfs/dsl_dataset.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 0f0783b7d..d4a3a9e41 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -2072,7 +2072,8 @@ dsl_dataset_rename_snapshot_sync_impl(dsl_pool_t *dp, VERIFY0(dsl_dataset_snap_remove(hds, ddrsa->ddrsa_oldsnapname, tx, B_FALSE)); mutex_enter(&ds->ds_lock); - (void) strcpy(ds->ds_snapname, ddrsa->ddrsa_newsnapname); + (void) strlcpy(ds->ds_snapname, ddrsa->ddrsa_newsnapname, + sizeof (ds->ds_snapname)); mutex_exit(&ds->ds_lock); VERIFY0(zap_add(dp->dp_meta_objset, dsl_dataset_phys(hds)->ds_snapnames_zapobj, |