Skip to content

Commit

Permalink
imap-send: check NULL return of SSL_CTX_new()
Browse files Browse the repository at this point in the history
SSL_CTX_new() may fail with return value NULL.

Signed-off-by: Kazuki Yamaguchi <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
rhenium authored and gitster committed Apr 8, 2016
1 parent 1ed2c7b commit 6738a33
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions imap-send.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
}

ctx = SSL_CTX_new(meth);
if (!ctx) {
ssl_socket_perror("SSL_CTX_new");
return -1;
}

if (verify)
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);
Expand Down

0 comments on commit 6738a33

Please sign in to comment.