mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #23804: Merge SSL recv() fix from 3.5
This commit is contained in:
commit
7386268ffd
3 changed files with 32 additions and 8 deletions
|
@ -1913,6 +1913,10 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
|
|||
dest = PyBytes_FromStringAndSize(NULL, len);
|
||||
if (dest == NULL)
|
||||
goto error;
|
||||
if (len == 0) {
|
||||
Py_XDECREF(sock);
|
||||
return dest;
|
||||
}
|
||||
mem = PyBytes_AS_STRING(dest);
|
||||
}
|
||||
else {
|
||||
|
@ -1924,6 +1928,10 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
|
|||
"maximum length can't fit in a C 'int'");
|
||||
goto error;
|
||||
}
|
||||
if (len == 0) {
|
||||
count = 0;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue