[PATCH libvirt-python v3 10/40] Remove use of virStrcpyStatic

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

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 libvirt-override.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libvirt-override.c b/libvirt-override.c
index e0df994..45c5652 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -189,7 +189,8 @@ setPyVirTypedParameter(PyObject *info,
             goto cleanup;
         }
 
-        ignore_value(virStrcpyStatic(temp->field, keystr));
+        strncpy(temp->field, keystr, sizeof(*temp->field) - 1);
+        temp->field[sizeof(*temp->field) - 1] = '\0';
         temp->type = params[i].type;
 
         switch (params[i].type) {
-- 
1.8.3.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]