aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zap_micro.c
diff options
context:
space:
mode:
authorcao <[email protected]>2016-09-26 06:08:28 +0800
committerBrian Behlendorf <[email protected]>2016-09-25 15:08:28 -0700
commit680eada9b05415a8e564eb345f062f357d66f0f1 (patch)
treec5f5e5d881d09166544b6a18bdf00f8dea5d48fa /module/zfs/zap_micro.c
parent92bc9278689fcce48183182f2488ead42a9eb790 (diff)
Fix coverity defects: CID 147650, 147649, 147647, 147646
coverity scan CID:147650, Type:copy into fixed size buffer. coverity scan CID:147649, Type:copy into fixed size buffer. coverity scan CID:147647, Type:copy into fixed size buffer. coverity scan CID:147646, Type:copy into fixed size buffer. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5161
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 df952146b..a15e22c5b 100644
--- a/module/zfs/zap_micro.c
+++ b/module/zfs/zap_micro.c
@@ -1110,7 +1110,8 @@ again:
if (mze->mze_name[0] == 0) {
mze->mze_value = value;
mze->mze_cd = cd;
- (void) strcpy(mze->mze_name, zn->zn_key_orig);
+ (void) strlcpy(mze->mze_name, zn->zn_key_orig,
+ sizeof (mze->mze_name));
zap->zap_m.zap_num_entries++;
zap->zap_m.zap_alloc_next = i+1;
if (zap->zap_m.zap_alloc_next ==