From 2667a76b7909799ed5bded4d8b5216ccf468ba77 Mon Sep 17 00:00:00 2001 From: Josh Hunt Date: Wed, 27 Mar 2024 16:50:20 -0700 Subject: [PATCH] Fix SSL_read/write return value checking in ma_tls_async_check_result SSL_{read,write}'s return values == 0 signify the operation was unsuccessful, but here it's being treated as success. Other calls of these functions already properly checks the return value. Signed-off-by: Josh Hunt --- 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 a21d692e0..ef6be9b14 100644 --- a/libmariadb/secure/openssl.c +++ b/libmariadb/secure/openssl.c @@ -529,7 +529,7 @@ ma_tls_async_check_result(int res, struct mysql_async_context *b, SSL *ssl) { int ssl_err; b->events_to_wait_for= 0; - if (res >= 0) + if (res > 0) return 1; ssl_err= SSL_get_error(ssl, res); if (ssl_err == SSL_ERROR_WANT_READ)