mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #26644: Merge SSL negative read fix from 3.5
This commit is contained in:
commit
afd465d497
3 changed files with 19 additions and 0 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue