From 3e3f64f05fa5d970b058c4b21b6ecd40b883e8e6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 5 Aug 2009 10:35:45 +1000 Subject: s4:ldb initialise e->values[i].length before use in python bindings --- source4/lib/ldb/pyldb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/ldb') diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index a05aab5b83..8a061c7e8e 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -1544,9 +1544,9 @@ static PyObject *py_ldb_msg_element_new(PyTypeObject *type, PyObject *args, PyOb el->values = talloc_array(el, struct ldb_val, el->num_values); for (i = 0; i < el->num_values; i++) { PyObject *item = PySequence_GetItem(py_elements, i); + el->values[i].length = PyString_Size(item); el->values[i].data = talloc_memdup(el, (uint8_t *)PyString_AsString(item), el->values[i].length); - el->values[i].length = PyString_Size(item); } } else { PyErr_SetString(PyExc_TypeError, -- cgit