All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kazuki Yamaguchi <k@rhe.jp>
To: git@vger.kernel.org
Cc: Kazuki Yamaguchi <k@rhe.jp>
Subject: [PATCH 2/4] imap-send: check NULL return of SSL_CTX_new()
Date: Sat,  9 Apr 2016 01:22:14 +0900	[thread overview]
Message-ID: <929766804585e24d7fcdc8acb7dd4835b3069d45.1460130092.git.k@rhe.jp> (raw)
In-Reply-To: <cover.1460130092.git.k@rhe.jp>
In-Reply-To: <cover.1460130092.git.k@rhe.jp>

SSL_CTX_new() may fail with return value NULL.

Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
---
 imap-send.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/imap-send.c b/imap-send.c
index 0364b326e109..c5e24a35491d 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);
-- 
2.8.1.104.g0d1aca6

  parent reply	other threads:[~2016-04-08 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 16:22 [PATCH 0/4] fix compilation with OpenSSL 1.1.0-pre4 Kazuki Yamaguchi
2016-04-08 16:22 ` [PATCH 1/4] imap-send: use HMAC() function provided by OpenSSL Kazuki Yamaguchi
2016-04-08 16:22 ` Kazuki Yamaguchi [this message]
2016-04-08 16:22 ` [PATCH 3/4] imap-send: avoid deprecated TLSv1_method() Kazuki Yamaguchi
2016-04-08 16:22 ` [PATCH 4/4] configure: remove checking for HMAC_CTX_cleanup Kazuki Yamaguchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=929766804585e24d7fcdc8acb7dd4835b3069d45.1460130092.git.k@rhe.jp \
    --to=k@rhe.jp \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.