Christian Heimes added the comment:

Oh sorry, I looked in the wrong location and missed it.

* if (PyErr_CheckSignals() < 0) {return NULL;} does not free buffer with 
PyMem_Free(buffer);

* The function allocates memory once with PyMem_Malloc() and later a second 
time with PyBytes_FromStringAndSize(buffer, n). You can avoid the first 
allocation and a memcpy() with PyBytes_FromStringAndSize(NULL, n) and 
PyBytes_AS_STRING().

* The syscall can also raise EPERM as reported by a user on QNAP. IIRC a 
seccomp policy caused EPERM.

----------
versions: +Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue27778>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to