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 d6354c1696
commit 6f1bfd6de5

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