]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
python: Handle embedded NUL in stream.send data
authorCole Robinson <crobinso@redhat.com>
Mon, 25 Jul 2011 15:44:36 +0000 (11:44 -0400)
committerCole Robinson <crobinso@redhat.com>
Mon, 25 Jul 2011 21:28:11 +0000 (17:28 -0400)
Otherwise things like volume upload are only useful with text data.

python/libvirt-override.c

index 9d1dac2e20c6196e743bcaf64f01996527eea62b..70e0238026a140c58f8b93a3a943a486966b5835 100644 (file)
@@ -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;
     }