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 Mar 27, 2024
1 parent 8228164 commit ee29dfa
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 @@ -533,7 +533,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 ee29dfa

Please sign in to comment.