bpo-9566: Fixed _ssl module warnings by segevfiner · Pull Request #2495 · python/cpython
..\Modules\_ssl.c(2947): warning C4244: '=': conversion from 'Py_ssize_t' to 'int', possible loss of data The Py_buffer can theoretically be larger... But I'm not sure that the protocol even supports that... Should this be casted away or fixed some other way?
_ssl__SSLContext__set_alpn_protocols_impl(). You must check for overflow manually: "if (len > INT_MAX) raise an exception;".
..\Modules\_ssl.c(4158): warning C4244: 'function': conversion from 'Py_ssize_t' to 'int', possible loss of data Someone can theoretically pass a buffer big enough...
_ssl_MemoryBIO_write_impl(): you cannot, there is "if (b->len > INT_MAX) { ... }" a few lines before, so the downcast is safe. Make it explicit with a "(int)" cast.