mirror of https://gitee.com/openkylin/libvirt.git
sanlock: Use virStrcpy instead of virStrncpy
We want a (possibly truncated) copy of the full source string so virStrcpy is a better fit. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
3442d8da3b
commit
33122ed16f
|
@ -924,9 +924,7 @@ static int virLockManagerSanlockAcquire(virLockManagerPtr lock,
|
||||||
|
|
||||||
/* sanlock doesn't use owner_name for anything, so it's safe to take just
|
/* sanlock doesn't use owner_name for anything, so it's safe to take just
|
||||||
* the first SANLK_NAME_LEN - 1 characters from vm_name */
|
* the first SANLK_NAME_LEN - 1 characters from vm_name */
|
||||||
ignore_value(virStrncpy(opt->owner_name, priv->vm_name,
|
virStrcpy(opt->owner_name, priv->vm_name, SANLK_NAME_LEN);
|
||||||
MIN(strlen(priv->vm_name), SANLK_NAME_LEN - 1),
|
|
||||||
SANLK_NAME_LEN));
|
|
||||||
|
|
||||||
if (state && STRNEQ(state, "")) {
|
if (state && STRNEQ(state, "")) {
|
||||||
if ((rv = sanlock_state_to_args((char *)state,
|
if ((rv = sanlock_state_to_args((char *)state,
|
||||||
|
|
Loading…
Reference in New Issue