Skip to content

Commit

Permalink
lib-ssl-iostream: Assert-crash if input stream has IO already set
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Feb 8, 2018
1 parent 5a9bbcb commit d3ce8ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib-ssl-iostream/iostream-openssl.c
Expand Up @@ -254,6 +254,10 @@ openssl_iostream_create(struct ssl_iostream_context *ctx, const char *host,
SSL *ssl;
BIO *bio_int, *bio_ext;

/* Don't allow an existing io_add_istream() to be use on the input.
It would seem to work, but it would also cause hangs. */
i_assert(i_stream_get_root_io(*input)->real_stream->io == NULL);

ssl = SSL_new(ctx->ssl_ctx);
if (ssl == NULL) {
*error_r = t_strdup_printf("SSL_new() failed: %s",
Expand Down

0 comments on commit d3ce8ba

Please sign in to comment.