Skip to content

Commit 05d89e7

Browse files
committed
streams: openssl: Handle error in SSL_CTX_new
SIGSEGV otherwise...
1 parent e6cdd17 commit 05d89e7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/streams/openssl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ int git_openssl_stream_global_init(void)
219219
* to speak TLSv1 to perform the encryption itself.
220220
*/
221221
git__ssl_ctx = SSL_CTX_new(SSLv23_method());
222+
if (!git__ssl_ctx) {
223+
return -1;
224+
}
225+
222226
SSL_CTX_set_options(git__ssl_ctx, ssl_opts);
223227
SSL_CTX_set_mode(git__ssl_ctx, SSL_MODE_AUTO_RETRY);
224228
SSL_CTX_set_verify(git__ssl_ctx, SSL_VERIFY_NONE, NULL);

0 commit comments

Comments
 (0)