Skip to content

Commit 5a61559

Browse files
vstinnertiran
authored andcommitted
_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]
1 parent dae0276 commit 5a61559

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Modules/_ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3086,7 +3086,7 @@ _ssl__SSLContext__set_alpn_protocols_impl(PySSLContext *self,
30863086
/*[clinic end generated code: output=87599a7f76651a9b input=9bba964595d519be]*/
30873087
{
30883088
#ifdef HAVE_ALPN
3089-
if (protos->len > UINT_MAX) {
3089+
if ((size_t)protos->len > UINT_MAX) {
30903090
PyErr_Format(PyExc_OverflowError,
30913091
"protocols longer than %d bytes", UINT_MAX);
30923092
return NULL;

0 commit comments

Comments
 (0)