aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zap_micro.c
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2020-06-08 03:42:12 +0900
committerGitHub <[email protected]>2020-06-07 11:42:12 -0700
commitc9e319faae9677aa0dddfbf9973b9e8fc3feb06c (patch)
tree3d6677913e5f26d91b7f35bcb62b9b354287db61 /module/zfs/zap_micro.c
parent60265072e02049be708f74cf0865eba2434a2d85 (diff)
Replace sprintf()->snprintf() and strcpy()->strlcpy()
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #10400
Diffstat (limited to 'module/zfs/zap_micro.c')
-rw-r--r--module/zfs/zap_micro.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c
index c3d42d0ee..33e951afc 100644
--- a/module/zfs/zap_micro.c
+++ b/module/zfs/zap_micro.c
@@ -1602,7 +1602,8 @@ zap_cursor_retrieve(zap_cursor_t *zc, zap_attribute_t *za)
za->za_integer_length = 8;
za->za_num_integers = 1;
za->za_first_integer = mzep->mze_value;
- (void) strcpy(za->za_name, mzep->mze_name);
+ (void) strlcpy(za->za_name, mzep->mze_name,
+ sizeof (za->za_name));
zc->zc_hash = mze->mze_hash;
zc->zc_cd = mze->mze_cd;
err = 0;