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:
parent
4151df32c1
commit
b8d5744c6e
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user