]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 153394
authorluozhengzheng <luo.zhengzheng@zte.com.cn>
Wed, 12 Oct 2016 20:24:03 +0000 (04:24 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Oct 2016 20:24:03 +0000 (13:24 -0700)
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

module/zfs/dmu_objset.c

index b1f05cb6108ba88fa41af50b005d2e45192cca22..cce3e732cbdad682d165b93a04b07fb07a761639 100644 (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);
        if (uqn == NULL) {
                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);
        }
        uqn->uqn_delta += delta;