diff options
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/dsl_dataset.c | 3 | ||||
-rw-r--r-- | module/zfs/dsl_dir.c | 3 |
2 files changed, 4 insertions, 2 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, diff --git a/module/zfs/dsl_dir.c b/module/zfs/dsl_dir.c index 59d382214..b21735235 100644 --- a/module/zfs/dsl_dir.c +++ b/module/zfs/dsl_dir.c @@ -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, |