]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virDevMapperGetTargetsImpl: Use virStrcpy instead of virStrncpy
authorPeter Krempa <pkrempa@redhat.com>
Tue, 2 Mar 2021 11:49:05 +0000 (12:49 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 5 Mar 2021 14:01:29 +0000 (15:01 +0100)
virStrncpy was called with -1 for length of the copied source which is
equivalent to virStrcpy.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virdevmapper.c

index d97334bf6787de29373c9410aeda28a18ff058f2..fcb11e954f61bf3e973c1915055339e147ac374a 100644 (file)
@@ -240,7 +240,7 @@ virDevMapperGetTargetsImpl(int controlFD,
     if (!(sanitizedPath = virDMSanitizepath(path)))
         return 0;
 
-    if (virStrncpy(dm.name, sanitizedPath, -1, DM_TABLE_DEPS) < 0) {
+    if (virStrcpy(dm.name, sanitizedPath, DM_TABLE_DEPS) < 0) {
         virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
                        _("Resolved device mapper name too long"));
         return -1;