1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

ldb: Adjust to PY_SSIZE_T_CLEAN and use Py_ssize_t consistently with PyArg_ParseTuple*()

This was inconsistent after dd7baa2ae2,
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>
This commit is contained in:
Andrew Bartlett 2016-01-04 12:42:06 +13:00
parent 46b8d7fc52
commit 4894811daf

View File

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