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:
parent
7e5e98e4f2
commit
b84702349f
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user