From: Martin v. Löwis Date: Mon, 27 Oct 2003 14:24:41 +0000 (+0000) Subject: Patch #803998: Correctly check for error in SSL_write. X-Git-Tag: v2.3.3c1~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=065b87b2d79df0c9e2841eb781bcf05cb1071d48;p=thirdparty%2FPython%2Fcpython.git Patch #803998: Correctly check for error in SSL_write. --- diff --git a/Misc/NEWS b/Misc/NEWS index d36d360d1bb9..526943834742 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -18,6 +18,8 @@ Core and builtins Extension modules ----------------- +- Patch #803998: Deal with errors in SSL_write correctly. + - The xml.parsers.expat module now provides Expat 1.95.7. - Patch #813445: Add missing socket.IPPROTO_IPV6. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index b338aeafe1a1..5fcf84ca2e9e 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -373,10 +373,11 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args) { char *data; int len; + int count; int timedout; int err; - if (!PyArg_ParseTuple(args, "s#:write", &data, &len)) + if (!PyArg_ParseTuple(args, "s#:write", &data, &count)) return NULL; timedout = wait_for_timeout(self->Socket, 1); @@ -387,7 +388,7 @@ static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args) do { err = 0; Py_BEGIN_ALLOW_THREADS - len = SSL_write(self->ssl, data, len); + len = SSL_write(self->ssl, data, count); err = SSL_get_error(self->ssl, len); Py_END_ALLOW_THREADS if(PyErr_CheckSignals()) {