Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 405a795

Browse files
committed
Patch #803998: Correctly check for error in SSL_write.
1 parent 11892ec commit 405a795

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Modules/_ssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
373373
{
374374
char *data;
375375
int len;
376+
int count;
376377
int timedout;
377378
int err;
378379

379-
if (!PyArg_ParseTuple(args, "s#:write", &data, &len))
380+
if (!PyArg_ParseTuple(args, "s#:write", &data, &count))
380381
return NULL;
381382

382383
timedout = wait_for_timeout(self->Socket, 1);
@@ -387,7 +388,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args)
387388
do {
388389
err = 0;
389390
Py_BEGIN_ALLOW_THREADS
390-
len = SSL_write(self->ssl, data, len);
391+
len = SSL_write(self->ssl, data, count);
391392
err = SSL_get_error(self->ssl, len);
392393
Py_END_ALLOW_THREADS
393394
if(PyErr_CheckSignals()) {

0 commit comments

Comments
 (0)