[libvirt] [PATCH] python: Handle embedded NULL in stream.send data

Cole Robinson crobinso at redhat.com
Mon Jul 25 15:45:55 UTC 2011


Otherwise things like volume upload are only useful with text data.
---
 python/libvirt-override.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 9d1dac2..70e0238 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -4151,11 +4151,12 @@ libvirt_virStreamSend(PyObject *self ATTRIBUTE_UNUSED,
     PyObject *pyobj_stream;
     virStreamPtr stream;
     char *data;
+    int datalen;
     int ret;
     int nbytes;
 
-    if (!PyArg_ParseTuple(args, (char *) "Ozi:virStreamRecv",
-                          &pyobj_stream, &data, &nbytes)) {
+    if (!PyArg_ParseTuple(args, (char *) "Oz#i:virStreamRecv",
+                          &pyobj_stream, &data, &datalen, &nbytes)) {
         DEBUG("%s failed to parse tuple\n", __FUNCTION__);
         return VIR_PY_INT_FAIL;
     }
-- 
1.7.4.4




More information about the libvir-list mailing list