summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-05 10:35:45 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-05 10:35:45 +1000
commit3e3f64f05fa5d970b058c4b21b6ecd40b883e8e6 (patch)
treec402115b681e62ff866c1fec1de650d81230608f /source4
parent43aa546ecc3f05845793b1a7354685d50a77c170 (diff)
downloadsamba-3e3f64f05fa5d970b058c4b21b6ecd40b883e8e6.tar.gz
samba-3e3f64f05fa5d970b058c4b21b6ecd40b883e8e6.tar.bz2
samba-3e3f64f05fa5d970b058c4b21b6ecd40b883e8e6.zip
s4:ldb initialise e->values[i].length before use in python bindings
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/pyldb.c2
1 files changed, 1 insertions, 1 deletions
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,