Skip to content

Commit 6738a33

Browse files
rheniumgitster
authored andcommitted
imap-send: check NULL return of SSL_CTX_new()
SSL_CTX_new() may fail with return value NULL. Signed-off-by: Kazuki Yamaguchi <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ed2c7b commit 6738a33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

imap-send.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,10 @@ static int ssl_socket_connect(struct imap_socket *sock, int use_tls_only, int ve
298298
}
299299

300300
ctx = SSL_CTX_new(meth);
301+
if (!ctx) {
302+
ssl_socket_perror("SSL_CTX_new");
303+
return -1;
304+
}
301305

302306
if (verify)
303307
SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, NULL);

0 commit comments

Comments
 (0)