summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-05-08 15:42:03 +0100
committerDaniel P. Berrange <berrange@redhat.com>2013-05-09 17:02:11 +0100
commitc1075880bab95deb32046dfe988813b1ea536065 (patch)
treeae6e8e30c704d58547e6d20f83e14c62cd108129
parent71b7f59c5b9528449630e40ca947dd71ac51e4dc (diff)
downloadlibvirt-python-split-c1075880bab95deb32046dfe988813b1ea536065.zip
libvirt-python-split-c1075880bab95deb32046dfe988813b1ea536065.tar.gz
libvirt-python-split-c1075880bab95deb32046dfe988813b1ea536065.tar.xz
Fix build of python bindings on Python 2.4CVE-2013-1962
The PyDict_Next method on Python <= 2.4 used 'int' instead of "Py_ssize_t" for the 'pos' parameter Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--libvirt-override.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libvirt-override.c b/libvirt-override.c
index 856789a..fd9ebb8 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -152,7 +152,11 @@ setPyVirTypedParameter(PyObject *info,
const virTypedParameterPtr params, int nparams)
{
PyObject *key, *value;
+#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4
+ int pos = 0;
+#else
Py_ssize_t pos = 0;
+#endif
virTypedParameterPtr temp = NULL, ret = NULL;
Py_ssize_t size;
int i;