Skip to content

Commit

Permalink
Fix SSL_read/write return value checking in ma_tls_async_check_result
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
geauxbears committed Apr 12, 2024
1 parent dab5973 commit 2667a76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libmariadb/secure/openssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2667a76

Please sign in to comment.