Skip to content

Commit

Permalink
bio_ssl.c: Do not call SSL_shutdown if not inited
Browse files Browse the repository at this point in the history
Fixes openssl#4545

If free is called for an SSL BIO that is in initialization phase,
the `SSL_shutdown` call is omitted.

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Paul Dale <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#24705)
  • Loading branch information
erbsland-dev authored and t8m committed Jun 25, 2024
1 parent 42a8ef8 commit 57b83ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ssl/bio_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int ssl_free(BIO *a)
return 0;
bs = BIO_get_data(a);
if (BIO_get_shutdown(a)) {
if (bs->ssl != NULL)
if (bs->ssl != NULL && !SSL_in_init(bs->ssl))
SSL_shutdown(bs->ssl);
if (BIO_get_init(a))
SSL_free(bs->ssl);
Expand Down

0 comments on commit 57b83ed

Please sign in to comment.