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:
parent
9aa52bb37e
commit
333e1efa27
@ -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);
|
||||
|
@ -1 +0,0 @@
|
||||
^samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_random_bytes
|
Loading…
x
Reference in New Issue
Block a user