1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

pyglue: check talloc buffer for random bytes

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
This commit is contained in:
Douglas Bagnall 2019-08-05 00:28:31 +12:00 committed by Andreas Schneider
parent 9aa52bb37e
commit 333e1efa27
2 changed files with 4 additions and 1 deletions

View File

@ -101,6 +101,10 @@ static PyObject *py_generate_random_bytes(PyObject *self, PyObject *args)
return NULL;
bytes = talloc_zero_size(NULL, len);
if (bytes == NULL) {
PyErr_NoMemory();
return NULL;
}
generate_random_buffer(bytes, len);
ret = PyBytes_FromStringAndSize((const char *)bytes, len);
talloc_free(bytes);

View File

@ -1 +0,0 @@
^samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_random_bytes