From 88ce406c895acf8d310835c3af628542364d8129 Mon Sep 17 00:00:00 2001 From: Pauli Date: Wed, 17 Mar 2021 13:07:56 +1000 Subject: [PATCH] ssl: coverity 1465527 - dereference after null check Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/14589) --- ssl/ssl_rsa.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index b78d751818..cf410d6d87 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -424,6 +424,9 @@ static int use_certificate_chain_file(SSL_CTX *ctx, SSL *ssl, const char *file) void *passwd_callback_userdata; SSL_CTX *real_ctx = (ssl == NULL) ? ctx : ssl->ctx; + if (ctx == NULL && ssl == NULL) + return 0; + ERR_clear_error(); /* clear error stack for * SSL_CTX_use_certificate() */