[PATCH 06/16] xenParseXMDisk: Replace g_new + virStrncpy by g_strndup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/libxl/xen_xm.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/src/libxl/xen_xm.c b/src/libxl/xen_xm.c
index 3e81c9ef0d..cc24317a76 100644
--- a/src/libxl/xen_xm.c
+++ b/src/libxl/xen_xm.c
@@ -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 */
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux