Commit 5a61559f authored by Victor Stinner's avatar Victor Stinner Committed by Christian Heimes

_ssl_: Fix compiler warning (#3559)

Cast Py_buffer.len (Py_ssize_t, signed) to size_t (unsigned) to
prevent the following warning:

Modules/_ssl.c:3089:21: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
parent dae0276b
......@@ -3086,7 +3086,7 @@ _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self,
/*[clinic end generated code: output=87599a7f76651a9b input=9bba964595d519be]*/
{
#ifdef HAVE_ALPN
if (protos->len > UINT_MAX) {
if ((size_t)protos->len > UINT_MAX) {
PyErr_Format(PyExc_OverflowError,
"protocols longer than %d bytes", UINT_MAX);
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment