mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
s4:ldb initialise e->values[i].length before use in python bindings
This commit is contained in:
parent
43aa546ecc
commit
3e3f64f05f
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user