master - cleanup: just safely copy string
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9d2c445d0ac10bf54d39d9aa6e8695c469456489 Commit: 9d2c445d0ac10bf54d39d9aa6e8695c469456489 Parent: 86e116450ec32243f10abbe9b093bdeaab6e0f76 Author: Zdenek Kabelac <[email protected]> AuthorDate: Thu Jul 3 21:31:15 2014 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Fri Jul 4 12:31:17 2014 +0200
cleanup: just safely copy string
Keep analyzers happier and use constrained strcpy.
--- lib/cache/lvmcache.c | 2 +- lib/format1/import-export.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/cache/lvmcache.c +1 -1
@@ -1707,7 +1707,7 @@ static int _get_pv_if_in_vg(struct lvmcache_info *info,* lvmcache_label_scan() and drop cached * vginfo so make a local copy of string. */ -strcpy (vgname, info->vginfo->vgname); + (void )dm_strncpy (vgname, info->vginfo->vgname,sizeof (vgname));memcpy (vgid, info->vginfo->vgid,sizeof (vgid)); if (get_pv_from_vg_by_id(info->fmt, vgname, vgid,
lib/format1/import-export.c +1 -1
@@ -347,7 +347,7 @@ static void _export_lv(struct lv_disk *lvd, struct volume_group *vg,snprintf ((char *)lvd->lv_name,sizeof (lvd->lv_name),"%s%s/%s" , dev_dir, vg->name, lv->name); -strcpy ((char *)lvd->vg_name, vg->name); + (void )dm_strncpy ((char *)lvd->vg_name, vg->name,sizeof (lvd->vg_name));if (lv->status &LVM_READ ) lvd->lv_access |=LV_READ ;