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

deviced_id: use zalloc

While moving to dm_strncpy, in this case since pvid is also
passed to crc calc, make sure whole buffer is always initilized.
This commit is contained in:
Zdenek Kabelac 2024-03-29 22:43:06 +01:00
parent 4151df32c1
commit b8d5744c6e

View File

@ -66,8 +66,8 @@ char devices_file_product_uuid_orig[PATH_MAX];
char *strdup_pvid(char *pvid)
{
char *buf;
if (!(buf = malloc(ID_LEN + 1)))
return NULL;
if (!(buf = zalloc(ID_LEN + 1)))
return_NULL;
(void)dm_strncpy(buf, pvid, ID_LEN + 1);
return buf;
}