From 1dbf61fa46d9b0c6a95096ed24638217951ff8b9 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 22 Nov 2013 00:34:18 +0100 Subject: downcast len to int. The code has already checked that len < INT_MAX --- Modules/_ssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/_ssl.c b/Modules/_ssl.c index d2f0d92..69b1eef 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -2520,7 +2520,7 @@ _add_ca_certs(PySSLContext *self, void *data, Py_ssize_t len, return -1; } - biobuf = BIO_new_mem_buf(data, len); + biobuf = BIO_new_mem_buf(data, (int)len); if (biobuf == NULL) { _setSSLError("Can't allocate buffer", 0, __FILE__, __LINE__); return -1; -- cgit v0.12 From d6dc952e17d11aace7bb9890bb2a2194308d8e4f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 22 Nov 2013 00:39:38 +0100 Subject: one CERT_REQUIRED is enough --- Lib/test/test_ssl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 2da1386..9996ff1 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -1801,7 +1801,6 @@ else: context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) context.verify_mode = ssl.CERT_REQUIRED context.load_verify_locations(SIGNING_CA) - context.verify_mode = ssl.CERT_REQUIRED context.verify_flags = ssl.VERIFY_DEFAULT # VERIFY_DEFAULT should pass -- cgit v0.12 From ba723200ce3effa5bea05a10fd01e3bb89ea8da7 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Fri, 22 Nov 2013 00:46:18 +0100 Subject: silence an overflow warning. slen is smaller than 1MB --- Modules/pyexpat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index e11c153..3f51c12 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -835,7 +835,8 @@ xmlparse_Parse(xmlparseobject *self, PyObject *args) s += MAX_CHUNK_SIZE; slen -= MAX_CHUNK_SIZE; } - rc = XML_Parse(self->itself, s, slen, isFinal); + assert(MAX_CHUNK_SIZE < INT_MAX && slen < INT_MAX); + rc = XML_Parse(self->itself, s, (int)slen, isFinal); done: if (view.buf != NULL) -- cgit v0.12