summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-01-04 12:42:06 +1300
committerAndrew Bartlett <abartlet@samba.org>2016-01-07 23:33:10 +0100
commit4894811dafafc57de98bf5271b3ee133622cefb6 (patch)
tree07d012483e55f530a16334b2a91fe69dc63739e3
parent46b8d7fc522f2fa084b56451ce3775e7138e2bca (diff)
downloadsamba-4894811dafafc57de98bf5271b3ee133622cefb6.tar.gz
ldb: Adjust to PY_SSIZE_T_CLEAN and use Py_ssize_t consistently with PyArg_ParseTuple*()
This was inconsistent after dd7baa2ae2f98d5c1e82fa97f223925025da5ca0, and may be the cause of test errors on s390x. (The change to py_ldb_dn_set_component() kept the Py_ssize_t type for 'size' without setting the PY_SSIZE_T_CLEAN macro to have PyArg_ParseTuple() expect a Py_ssize_t. Instead, PyArg_ParseTuple() expected an int. See in particular debian bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=808769 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
-rw-r--r--lib/ldb/pyldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index fff1feee4da..3daed96f20d 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -489,7 +489,7 @@ static PyObject *py_ldb_dn_set_extended_component(PyLdbDnObject *self, PyObject
char *name;
int err;
uint8_t *value;
- int size = 0;
+ Py_ssize_t size = 0;
if (!PyArg_ParseTuple(args, "sz#", &name, (const char**)&value, &size))
return NULL;
@@ -3642,7 +3642,7 @@ static PyObject *py_valid_attr_name(PyObject *self, PyObject *args)
static PyObject *py_binary_encode(PyObject *self, PyObject *args)
{
char *str, *encoded;
- int size = 0;
+ Py_ssize_t size = 0;
struct ldb_val val;
PyObject *ret;