1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: ensure buffer is nul ended

Use dm_strncpy() to ensure ending nul.
This commit is contained in:
Zdenek Kabelac 2024-03-25 16:37:04 +01:00
parent 7e5e98e4f2
commit b84702349f

View File

@ -181,9 +181,9 @@ int get_pvs_online(struct dm_list *pvs_online, const char *vgname)
if (file_major || file_minor)
po->devno = MKDEV(file_major, file_minor);
if (file_vgname[0])
strncpy(po->vgname, file_vgname, NAME_LEN);
(void)dm_strncpy(po->vgname, file_vgname, sizeof(po->vgname));
if (file_devname[0])
strncpy(po->devname, file_devname, NAME_LEN);
(void)dm_strncpy(po->devname, file_devname, sizeof(po->devname));
log_debug("Found PV online %s for VG %s %s", path, vgname, file_devname);
dm_list_add(pvs_online, &po->list);