Fix coverity defects: CID 153394

coverity scan CID 153394, Type:String overflow

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: luozhengzheng <luo.zhengzheng@zte.com.cn>
Closes #5263
This commit is contained in:
luozhengzheng 2016-10-13 04:24:03 +08:00 committed by Brian Behlendorf
parent ef78750d98
commit 1f51b525ff

View File

@ -1405,7 +1405,7 @@ userquota_update_cache(avl_tree_t *avl, const char *id, int64_t delta)
uqn = avl_find(avl, (const void *)id, &idx); uqn = avl_find(avl, (const void *)id, &idx);
if (uqn == NULL) { if (uqn == NULL) {
uqn = kmem_zalloc(sizeof (*uqn), KM_SLEEP); uqn = kmem_zalloc(sizeof (*uqn), KM_SLEEP);
strcpy(uqn->uqn_id, id); strlcpy(uqn->uqn_id, id, sizeof (uqn->uqn_id));
avl_insert(avl, uqn, idx); avl_insert(avl, uqn, idx);
} }
uqn->uqn_delta += delta; uqn->uqn_delta += delta;