summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-04-08 16:22:14 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-04-08 18:46:22 (GMT)
commit6738a33b3102222b25f7a1596aa1ed39c478a268 (patch)
tree9e934e9e819cdc9c297f7f6a1d4beefaa33c1dae
parent1ed2c7b11570f5d16bdc70d151fa78c3dccf6d38 (diff)
downloadgit-6738a33b3102222b25f7a1596aa1ed39c478a268.zip
git-6738a33b3102222b25f7a1596aa1ed39c478a268.tar.gz
git-6738a33b3102222b25f7a1596aa1ed39c478a268.tar.bz2
imap-send: check NULL return of SSL_CTX_new()
SSL_CTX_new() may fail with return value NULL. Signed-off-by: Kazuki Yamaguchi <k@rhe.jp> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--imap-send.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/imap-send.c b/imap-send.c
index 8bf363b..e964e2a 100644
--- a/imap-send.c
+++ b/imap-send.c
@@ -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);