1
0
mirror of https://gitlab.com/libvirt/libvirt-python.git synced 2025-07-14 16:59:34 +03:00

python: Handle embedded NUL in stream.send data

Otherwise things like volume upload are only useful with text data.
This commit is contained in:
Cole Robinson
2011-07-25 11:44:36 -04:00
parent 0fad55b22f
commit 6a8c4e100e

View 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;
}