Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fixed a bug in the :mod:`_ssl` module that was throwing :exc:`OverflowError`
when using :meth:`_ssl._SSLSocket.write` and :meth:`_ssl._SSLSocket.read`
for a big value of the ``len`` parameter. Patch by Pablo Galindo
12 changes: 6 additions & 6 deletions 12 Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,7 @@ _ssl__SSLSocket_write_impl(PySSLSocket *self, Py_buffer *b)

do {
PySSL_BEGIN_ALLOW_THREADS
retval = SSL_write_ex(self->ssl, b->buf, (int)b->len, &count);
retval = SSL_write_ex(self->ssl, b->buf, (size_t)b->len, &count);
err = _PySSL_errno(retval == 0, self->ssl, retval);
PySSL_END_ALLOW_THREADS
self->err = err;
Expand Down Expand Up @@ -2418,7 +2418,7 @@ _ssl__SSLSocket_pending_impl(PySSLSocket *self)

/*[clinic input]
_ssl._SSLSocket.read
size as len: int
size as len: Py_ssize_t
[
buffer: Py_buffer(accept={rwbuffer})
]
Expand All @@ -2428,9 +2428,9 @@ Read up to size bytes from the SSL socket.
[clinic start generated code]*/

static PyObject *
_ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,
Py_buffer *buffer)
/*[clinic end generated code: output=00097776cec2a0af input=ff157eb918d0905b]*/
_ssl__SSLSocket_read_impl(PySSLSocket *self, Py_ssize_t len,
int group_right_1, Py_buffer *buffer)
/*[clinic end generated code: output=49b16e6406023734 input=ec48bf622be1c4a1]*/
{
PyObject *dest = NULL;
char *mem;
Expand Down Expand Up @@ -2498,7 +2498,7 @@ _ssl__SSLSocket_read_impl(PySSLSocket *self, int len, int group_right_1,

do {
PySSL_BEGIN_ALLOW_THREADS
retval = SSL_read_ex(self->ssl, mem, len, &count);
retval = SSL_read_ex(self->ssl, mem, (size_t)len, &count);
err = _PySSL_errno(retval == 0, self->ssl, retval);
PySSL_END_ALLOW_THREADS
self->err = err;
Expand Down
12 changes: 6 additions & 6 deletions 12 Modules/clinic/_ssl.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.