diff options
author | Martin Panter <vadmium+py@gmail.com> | 2016-03-27 10:40:22 (GMT) |
---|---|---|
committer | Martin Panter <vadmium+py@gmail.com> | 2016-03-27 10:40:22 (GMT) |
commit | afd465d49707618f40d3c64fa499a38f9c9db3d2 (patch) | |
tree | 6e6efd88fc22bdb81236f159c95cb7c72c99b1ca /Modules | |
parent | 3625af5f2129f8e8735c54bd01d9f138dd5c0e83 (diff) | |
parent | 5503d4731e822e90eea387efa37934d2df41c784 (diff) | |
download | cpython-afd465d49707618f40d3c64fa499a38f9c9db3d2.zip cpython-afd465d49707618f40d3c64fa499a38f9c9db3d2.tar.gz cpython-afd465d49707618f40d3c64fa499a38f9c9db3d2.tar.bz2 |
Issue #26644: Merge SSL negative read fix from 3.5
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_ssl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index c96237e..838d5ba 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1895,6 +1895,11 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1, _PyTime_t timeout, deadline = 0; int has_timeout; + if (!group_right_1 && len < 0) { + PyErr_SetString(PyExc_ValueError, "size should not be negative"); + return NULL; + } + if (sock != NULL) { if (((PyObject*)sock) == Py_None) { _setSSLError("Underlying socket connection gone", |