mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: hide false positive warning
Here we have valid use case of strncpy() which just need to fill precise buffer size - so no explicit \0 on buffer end is needed.
This commit is contained in:
parent
63930f576a
commit
a14371e495
@ -2989,6 +2989,7 @@ static int add_lockspace_thread(const char *ls_name,
|
||||
}
|
||||
|
||||
if (vg_uuid)
|
||||
/* coverity[buffer_size_warning] */
|
||||
strncpy(ls->vg_uuid, vg_uuid, 64);
|
||||
|
||||
if (vg_name)
|
||||
|
@ -1250,9 +1250,11 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
|
||||
/* FIXME Until resume ioctl supplies name, use dev_name for readahead */
|
||||
if (DEV_NAME(dmt) && (dmt->type != DM_DEVICE_RESUME || dmt->minor < 0 ||
|
||||
dmt->major < 0))
|
||||
/* coverity[buffer_size_warning] */
|
||||
strncpy(dmi->name, DEV_NAME(dmt), sizeof(dmi->name));
|
||||
|
||||
if (DEV_UUID(dmt))
|
||||
/* coverity[buffer_size_warning] */
|
||||
strncpy(dmi->uuid, DEV_UUID(dmt), sizeof(dmi->uuid));
|
||||
|
||||
if (dmt->type == DM_DEVICE_SUSPEND)
|
||||
|
@ -1245,9 +1245,11 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
|
||||
(dmt->minor < 0) || (dmt->major < 0)))
|
||||
/* When RESUME or RELOAD sets maj:min and dev_name, use just maj:min,
|
||||
* passed dev_name is useful for better error/debug messages */
|
||||
/* coverity[buffer_size_warning] */
|
||||
strncpy(dmi->name, DEV_NAME(dmt), sizeof(dmi->name));
|
||||
|
||||
if (DEV_UUID(dmt))
|
||||
/* coverity[buffer_size_warning] */
|
||||
strncpy(dmi->uuid, DEV_UUID(dmt), sizeof(dmi->uuid));
|
||||
|
||||
if (dmt->type == DM_DEVICE_SUSPEND)
|
||||
|
Loading…
Reference in New Issue
Block a user