mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +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:
parent
4151df32c1
commit
b8d5744c6e
@ -66,8 +66,8 @@ char devices_file_product_uuid_orig[PATH_MAX];
|
|||||||
char *strdup_pvid(char *pvid)
|
char *strdup_pvid(char *pvid)
|
||||||
{
|
{
|
||||||
char *buf;
|
char *buf;
|
||||||
if (!(buf = malloc(ID_LEN + 1)))
|
if (!(buf = zalloc(ID_LEN + 1)))
|
||||||
return NULL;
|
return_NULL;
|
||||||
(void)dm_strncpy(buf, pvid, ID_LEN + 1);
|
(void)dm_strncpy(buf, pvid, ID_LEN + 1);
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user