mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
xenParseXMDisk: Replace g_new + virStrncpy by g_strndup
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
9595c61625
commit
bf5374d736
@ -146,14 +146,7 @@ xenParseXMDisk(char *entry, int hvm)
|
||||
if (!(offset = strchr(head, ',')))
|
||||
goto error;
|
||||
|
||||
disk->dst = g_new0(char, (offset - head) + 1);
|
||||
|
||||
if (virStrncpy(disk->dst, head, offset - head,
|
||||
(offset - head) + 1) < 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Dest file %s too big for destination"), head);
|
||||
goto error;
|
||||
}
|
||||
disk->dst = g_strndup(head, offset - head);
|
||||
|
||||
head = offset + 1;
|
||||
/* Extract source driver type */
|
||||
|
Loading…
x
Reference in New Issue
Block a user