mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
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 <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn> Closes #5160
This commit is contained in:
parent
12fa7f3436
commit
c9d61adbf8
@ -1221,7 +1221,8 @@ dump_snapshot(zfs_handle_t *zhp, void *arg)
|
||||
if (!sdd->seenfrom && isfromsnap) {
|
||||
gather_holds(zhp, sdd);
|
||||
sdd->seenfrom = B_TRUE;
|
||||
(void) strcpy(sdd->prevsnap, thissnap);
|
||||
(void) strlcpy(sdd->prevsnap, thissnap,
|
||||
sizeof (sdd->prevsnap));
|
||||
sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
|
||||
zfs_close(zhp);
|
||||
return (0);
|
||||
|
@ -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,
|
||||
|
@ -1904,7 +1904,8 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t *tx)
|
||||
dd->dd_myname, tx);
|
||||
ASSERT0(error);
|
||||
|
||||
(void) strcpy(dd->dd_myname, mynewname);
|
||||
(void) strlcpy(dd->dd_myname, mynewname,
|
||||
sizeof (dd->dd_myname));
|
||||
dsl_dir_rele(dd->dd_parent, dd);
|
||||
dsl_dir_phys(dd)->dd_parent_obj = newparent->dd_object;
|
||||
VERIFY0(dsl_dir_hold_obj(dp,
|
||||
|
Loading…
Reference in New Issue
Block a user