diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-09-07 16:40:45 (GMT) |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-09-07 16:40:45 (GMT) |
commit | b988ee0632a71dbc5e1c599ef46bff24b915c1c6 (patch) | |
tree | 33519dbb19daa52e7688f0d81a6ccbeacae8a33e /Modules/_multiprocessing | |
parent | 84eadd8651ac5f2b183c055ea8af5e20627b136b (diff) | |
download | cpython-b988ee0632a71dbc5e1c599ef46bff24b915c1c6.zip cpython-b988ee0632a71dbc5e1c599ef46bff24b915c1c6.tar.gz cpython-b988ee0632a71dbc5e1c599ef46bff24b915c1c6.tar.bz2 |
Fix conversion from Py_ssize_t to int.
Diffstat (limited to 'Modules/_multiprocessing')
-rw-r--r-- | Modules/_multiprocessing/multiprocessing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index 30cb5eb..1aaf360 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -99,13 +99,15 @@ multiprocessing_send(PyObject *self, PyObject *args) { HANDLE handle; Py_buffer buf; - int ret; + int ret, length; if (!PyArg_ParseTuple(args, F_HANDLE "y*:send" , &handle, &buf)) return NULL; + length = (int)Py_MIN(buf.len, INT_MAX); + Py_BEGIN_ALLOW_THREADS - ret = send((SOCKET) handle, buf.buf, buf.len, 0); + ret = send((SOCKET) handle, buf.buf, length, 0); Py_END_ALLOW_THREADS PyBuffer_Release(&buf); |