diff options
Diffstat (limited to 'modules/mbedtls')
-rwxr-xr-x | modules/mbedtls/stream_peer_mbed_tls.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/mbedtls/stream_peer_mbed_tls.cpp b/modules/mbedtls/stream_peer_mbed_tls.cpp index 973713f500..45d3b86919 100755 --- a/modules/mbedtls/stream_peer_mbed_tls.cpp +++ b/modules/mbedtls/stream_peer_mbed_tls.cpp @@ -270,7 +270,10 @@ void StreamPeerMbedTLS::poll() { return; } - int ret = mbedtls_ssl_read(&ssl, NULL, 0); + // We could pass NULL as second parameter, but some behaviour sanitizers doesn't seem to like that. + // Passing a 1 byte buffer to workaround it. + uint8_t byte; + int ret = mbedtls_ssl_read(&ssl, &byte, 0); if (ret == MBEDTLS_ERR_SSL_WANT_READ || ret == MBEDTLS_ERR_SSL_WANT_WRITE) { // Nothing to read/write (non blocking IO) @@ -313,7 +316,7 @@ void StreamPeerMbedTLS::disconnect_from_stream() { Ref<StreamPeerTCP> tcp = base; if (tcp.is_valid() && tcp->get_status() == StreamPeerTCP::STATUS_CONNECTED) { - // We are still connected on the socket, try to send close notity. + // We are still connected on the socket, try to send close notify. mbedtls_ssl_close_notify(&ssl); } |