From f1b08b836931daf5b20405b567a6dee2d6a89400 Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Fri, 8 Jul 2022 07:46:00 +0200 Subject: [PATCH] Partial fix for MDEV-27405: The return value of SSL_read indicates an error if it is <= 0, not if it is < 0. --- libmariadb/secure/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmariadb/secure/openssl.c b/libmariadb/secure/openssl.c index 5e29ef6f..62fcfdae 100644 --- a/libmariadb/secure/openssl.c +++ b/libmariadb/secure/openssl.c @@ -587,7 +587,7 @@ ssize_t ma_tls_read(MARIADB_TLS *ctls, const uchar* buffer, size_t length) int rc; MARIADB_PVIO *pvio= ctls->pvio; - while ((rc= SSL_read((SSL *)ctls->ssl, (void *)buffer, (int)length)) < 0) + while ((rc= SSL_read((SSL *)ctls->ssl, (void *)buffer, (int)length)) <= 0) { int error= SSL_get_error((SSL *)ctls->ssl, rc); if (error != SSL_ERROR_WANT_READ)